@declarion/react 0.45.0 → 0.47.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.
- package/dist-lib/{DraggableChildrenTable-BDnJK0AU.js → DraggableChildrenTable-B6KjWkwD.js} +2 -2
- package/dist-lib/{DynamicIcon-DeRpAaXm.js → DynamicIcon-Dc2j-rg_.js} +19 -17
- package/dist-lib/{Grid-CcCveEE7.js → Grid-OdquWJNX.js} +2 -2
- package/dist-lib/{LayoutRenderer-BReuhVdX.js → LayoutRenderer-CzAdhjNT.js} +525 -518
- package/dist-lib/{MarkdownRenderer-DPKDFR60.js → MarkdownRenderer-C6bhrAIe.js} +10 -10
- package/dist-lib/{RefreshControl-KddgOhUG.js → RefreshControl-F9Ib9asP.js} +18 -18
- package/dist-lib/{SmartDetailPage.impl-D_hMxiHy.js → SmartDetailPage.impl-DdSu3kmW.js} +305 -294
- package/dist-lib/{SmartRecordListPage.impl-GIo_mPIJ.js → SmartRecordListPage.impl-SkIp0_Rd.js} +165 -154
- package/dist-lib/api/agents.d.ts +39 -7
- package/dist-lib/components/agents/AgentChatPanel.d.ts +6 -1
- package/dist-lib/components/agents/transcript-runs.d.ts +29 -0
- package/dist-lib/components/file-widgets/host.d.ts +1 -0
- package/dist-lib/components/list/QuickPeek.d.ts +1 -1
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +4 -2
- package/dist-lib/components/pages/list/cardProjection.d.ts +2 -1
- package/dist-lib/components/shared/RowActionsKebab.d.ts +3 -2
- package/dist-lib/components/views/ViewSwitcher.d.ts +2 -1
- package/dist-lib/hooks/useAgentConversation.d.ts +7 -19
- package/dist-lib/hooks/useFilters.d.ts +1 -0
- package/dist-lib/icons.js +1 -1
- package/dist-lib/index.d.ts +8 -1
- package/dist-lib/index.js +3031 -2674
- package/dist-lib/lib/actions.d.ts +1 -1
- package/dist-lib/lib/filter-evaluator.d.ts +16 -0
- package/dist-lib/lib/filters.d.ts +10 -4
- package/dist-lib/lib/messages.d.ts +1 -0
- package/dist-lib/lib/variants.d.ts +7 -0
- package/dist-lib/{registry-DJKp0yaV.js → registry-C2VD-5MD.js} +571 -347
- package/dist-lib/testing.js +1 -1
- package/dist-lib/types/schema.d.ts +26 -0
- package/dist-lib/{useCurrentScreen-A3xZDs7U.js → useCurrentScreen-ow4r-nWa.js} +721 -693
- package/dist-lib/{useProperties-TlltWwLv.js → useProperties-lEKfzm2X.js} +92 -61
- package/dist-lib/{value-CHY7LgZ-.js → value-CXohNH6a.js} +1 -1
- package/dist-lib/vite/index.js +23 -22
- package/package.json +12 -12
package/dist-lib/api/agents.d.ts
CHANGED
|
@@ -57,13 +57,38 @@ export interface AgentMessage {
|
|
|
57
57
|
created_at: string;
|
|
58
58
|
streaming?: boolean;
|
|
59
59
|
}
|
|
60
|
-
export type
|
|
61
|
-
export interface
|
|
60
|
+
export type AgentTurnStatus = "queued" | "running" | "waiting" | "completed" | "failed" | "canceled";
|
|
61
|
+
export interface AgentTurn {
|
|
62
62
|
id: string;
|
|
63
63
|
conversation_id: string;
|
|
64
|
+
trigger_message_id: string;
|
|
65
|
+
runnable_message_seq: number;
|
|
66
|
+
status: AgentTurnStatus;
|
|
67
|
+
model_step: number;
|
|
68
|
+
reserved_assistant_message_id?: string | null;
|
|
69
|
+
error_code?: string | null;
|
|
70
|
+
error_details?: unknown;
|
|
71
|
+
}
|
|
72
|
+
export type AgentInvocationStatus = "proposed" | "pending_input" | "pending_approval" | "approved" | "rejected" | "running" | "succeeded" | "failed" | "canceled" | "interrupted" | "outcome_unknown";
|
|
73
|
+
export type AgentInvocationKind = "action" | "input_request" | "tool";
|
|
74
|
+
export interface AgentToolInvocation {
|
|
75
|
+
id: string;
|
|
76
|
+
conversation_id: string | null;
|
|
64
77
|
message_id: string | null;
|
|
78
|
+
kind: AgentInvocationKind;
|
|
79
|
+
turn_id: string | null;
|
|
80
|
+
assistant_message_id: string | null;
|
|
81
|
+
response_message_id: string | null;
|
|
82
|
+
provider_call_id: string | null;
|
|
83
|
+
call_ordinal: number | null;
|
|
84
|
+
server_code: string;
|
|
65
85
|
tool_code: string;
|
|
66
86
|
params: Record<string, unknown>;
|
|
87
|
+
question?: {
|
|
88
|
+
key?: string;
|
|
89
|
+
message?: string;
|
|
90
|
+
schema?: Record<string, unknown>;
|
|
91
|
+
};
|
|
67
92
|
status: AgentInvocationStatus;
|
|
68
93
|
approval?: {
|
|
69
94
|
decided_by?: string;
|
|
@@ -71,6 +96,7 @@ export interface AgentToolInvocation {
|
|
|
71
96
|
reason?: string;
|
|
72
97
|
edits?: Record<string, unknown>;
|
|
73
98
|
};
|
|
99
|
+
confirmation_mode?: "never" | "once_per_conversation" | "always";
|
|
74
100
|
result?: unknown;
|
|
75
101
|
audit_operation_id?: string;
|
|
76
102
|
reason?: string;
|
|
@@ -101,12 +127,18 @@ export declare function createConversation(input: {
|
|
|
101
127
|
agent_id?: string;
|
|
102
128
|
context?: Record<string, unknown>;
|
|
103
129
|
}): Promise<AgentConversation>;
|
|
104
|
-
export declare function sendMessage(text: string, conversationId: string
|
|
105
|
-
export declare function
|
|
106
|
-
export declare function
|
|
130
|
+
export declare function sendMessage(text: string, conversationId: string): Promise<AgentMessage>;
|
|
131
|
+
export declare function answerQuestion(invocationId: string, answer: Record<string, unknown>): Promise<void>;
|
|
132
|
+
export declare function sendElicitResponse(_conversationId: string, invocationId: string, data: Record<string, unknown>): Promise<void>;
|
|
133
|
+
/** What a person permitted: this call alone, or the action for the rest of
|
|
134
|
+
* the conversation. Absent means this call alone - the safe reading, and
|
|
135
|
+
* what every row written before the choice existed means. */
|
|
136
|
+
export type ApprovalScope = "call" | "conversation";
|
|
137
|
+
export declare function approveInvocation(id: string, scope?: ApprovalScope): Promise<void>;
|
|
107
138
|
export declare function rejectInvocation(id: string, note?: string): Promise<void>;
|
|
139
|
+
export declare function cancelInvocation(id: string): Promise<void>;
|
|
108
140
|
export declare function cancelConversation(id: string): Promise<void>;
|
|
109
141
|
export declare function listConversations(): Promise<AgentConversation[]>;
|
|
110
|
-
export declare function
|
|
111
|
-
export declare function
|
|
142
|
+
export declare function loadConversationTurns(conversationId: string): Promise<AgentTurn[]>;
|
|
143
|
+
export declare function loadConversationInvocations(conversationId: string): Promise<AgentToolInvocation[]>;
|
|
112
144
|
export declare function loadHistory(conversationId: string): Promise<AgentMessage[]>;
|
|
@@ -3,5 +3,10 @@ export interface AgentChatPanelProps {
|
|
|
3
3
|
onClose: () => void;
|
|
4
4
|
context?: string;
|
|
5
5
|
title?: string;
|
|
6
|
+
/** A question typed somewhere else - the command palette - to send once
|
|
7
|
+
* the panel opens. The palette promises "Press Enter to ask"; without
|
|
8
|
+
* this it opened the panel and threw the question away. */
|
|
9
|
+
askOnOpen?: string;
|
|
6
10
|
}
|
|
7
|
-
export declare function AgentChatPanel({ open, onClose, context, title }: AgentChatPanelProps): import("react").JSX.Element | null;
|
|
11
|
+
export declare function AgentChatPanel({ open, onClose, context, title, askOnOpen }: AgentChatPanelProps): import("react").JSX.Element | null;
|
|
12
|
+
export declare function proposalFallback(code: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentMessage, AgentToolInvocation } from "../../api/agents";
|
|
2
|
+
export type TranscriptItem = {
|
|
3
|
+
kind: "message";
|
|
4
|
+
message: AgentMessage;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "run";
|
|
7
|
+
id: string;
|
|
8
|
+
calls: TranscriptCall[];
|
|
9
|
+
};
|
|
10
|
+
/** One call, with its result folded in when it has arrived. */
|
|
11
|
+
export type TranscriptCall = {
|
|
12
|
+
/** The durable invocation id, when this call was persisted by the harness. */
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
input: unknown;
|
|
16
|
+
/** Absent until the platform answers. Absence means still running. */
|
|
17
|
+
output?: unknown;
|
|
18
|
+
isError?: boolean;
|
|
19
|
+
messageId: string;
|
|
20
|
+
status?: AgentToolInvocation["status"];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* fold turns a message list into what the transcript renders.
|
|
24
|
+
*
|
|
25
|
+
* Calls come from transcript blocks, while their state and result come from
|
|
26
|
+
* the exact durable invocation row. A run keeps the id of its FIRST message
|
|
27
|
+
* so expansion state survives later calls joining it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function fold(messages: AgentMessage[], invocations?: AgentToolInvocation[]): TranscriptItem[];
|
|
@@ -17,7 +17,7 @@ export interface QuickPeekFileFieldSpec {
|
|
|
17
17
|
}
|
|
18
18
|
export type QuickPeekFieldSpec = QuickPeekRegularFieldSpec | QuickPeekFileFieldSpec;
|
|
19
19
|
export interface QuickPeekProps<R extends Record<string, unknown> = Record<string, unknown>> {
|
|
20
|
-
entity: Pick<Entity, "fields" | "files">;
|
|
20
|
+
entity: Pick<Entity, "fields" | "files" | "variants">;
|
|
21
21
|
entityCode?: string;
|
|
22
22
|
record: R;
|
|
23
23
|
title: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ResolvedActionLayoutNode } from "../../../lib/actions";
|
|
2
2
|
import { type WidgetContext } from "../../../components/shared/ResponsiveActionBar";
|
|
3
|
-
import type { Action } from "../../../types/schema";
|
|
3
|
+
import type { Action, Entity, Screen } from "../../../types/schema";
|
|
4
4
|
export interface ListFloatbarProps {
|
|
5
5
|
selectedIds: string[];
|
|
6
6
|
/** Actions whose visibility includes `list_floatbar` - the floatbar slot.
|
|
@@ -19,9 +19,11 @@ export interface ListFloatbarProps {
|
|
|
19
19
|
data: Record<string, unknown>[];
|
|
20
20
|
rowKey: (row: Record<string, unknown>) => string;
|
|
21
21
|
entityCode?: string;
|
|
22
|
+
entity?: Entity;
|
|
23
|
+
screen?: Screen;
|
|
22
24
|
onClear: () => void;
|
|
23
25
|
onActionSuccess: () => void;
|
|
24
26
|
/** Dispatch surface threaded into ResponsiveActionBar (plan §8 Task 10). */
|
|
25
27
|
widgetContext: WidgetContext;
|
|
26
28
|
}
|
|
27
|
-
export declare function ListFloatbar({ selectedIds, floatbarActions, screenActionLayout, entityActionLayout, data, rowKey, entityCode, onClear, onActionSuccess, widgetContext, }: ListFloatbarProps): import("react").JSX.Element | null;
|
|
29
|
+
export declare function ListFloatbar({ selectedIds, floatbarActions, screenActionLayout, entityActionLayout, data, rowKey, entityCode, entity, screen, onClear, onActionSuccess, widgetContext, }: ListFloatbarProps): import("react").JSX.Element | null;
|
|
@@ -28,7 +28,7 @@ export interface ResolveCardArgs {
|
|
|
28
28
|
screen: Screen | undefined;
|
|
29
29
|
savedViewColumns?: readonly string[];
|
|
30
30
|
}
|
|
31
|
-
export type ProjectionReason = "render" | "display" | "display_template" | "condition" | "identity" | "sort" | "detail_handoff" | "quick_peek" | "ref_expand" | "status_expand" | "property_expand" | "evidence_expand" | "file_metadata";
|
|
31
|
+
export type ProjectionReason = "render" | "display" | "display_template" | "condition" | "variant" | "identity" | "sort" | "detail_handoff" | "quick_peek" | "ref_expand" | "status_expand" | "property_expand" | "evidence_expand" | "file_metadata";
|
|
32
32
|
export interface ProjectionReasons {
|
|
33
33
|
fields: Record<string, ProjectionReason[]>;
|
|
34
34
|
expand: Record<string, ProjectionReason[]>;
|
|
@@ -62,5 +62,6 @@ export interface ResolveListProjectionArgs {
|
|
|
62
62
|
}
|
|
63
63
|
export declare function resolveCard(args: ResolveCardArgs): ResolvedCard;
|
|
64
64
|
export declare function resolveListProjection(args: ResolveListProjectionArgs): ResolvedListProjection;
|
|
65
|
+
export declare function resolveVariantRenderFields(entity: Entity | undefined, screen: Screen | undefined, savedViewColumns?: readonly string[]): string[];
|
|
65
66
|
export declare function resolveQuickPeekFieldNames(entity: Entity | undefined, screen: Screen | undefined, screens: Schema["screens"] | undefined): string[];
|
|
66
67
|
export declare function extractDisplayTemplateFields(template: string | undefined): string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Action } from "../../types/schema";
|
|
1
|
+
import { type Action, type Entity } from "../../types/schema";
|
|
2
2
|
interface RowActionsKebabProps {
|
|
3
3
|
actions: Array<{
|
|
4
4
|
code: string;
|
|
@@ -6,6 +6,7 @@ interface RowActionsKebabProps {
|
|
|
6
6
|
}>;
|
|
7
7
|
objectIds: string[];
|
|
8
8
|
row?: Record<string, unknown>;
|
|
9
|
+
entity?: Entity;
|
|
9
10
|
onSuccess?: () => void;
|
|
10
11
|
/** Pre-menu slot for host-specific items (Edit, Delete, etc). */
|
|
11
12
|
preMenu?: React.ReactNode;
|
|
@@ -15,5 +16,5 @@ interface RowActionsKebabProps {
|
|
|
15
16
|
size?: number;
|
|
16
17
|
align?: "start" | "end";
|
|
17
18
|
}
|
|
18
|
-
export declare function RowActionsKebab({ actions, objectIds, row, onSuccess, preMenu, divider, size, align, }: RowActionsKebabProps): import("react").JSX.Element | null;
|
|
19
|
+
export declare function RowActionsKebab({ actions, objectIds, row, entity, onSuccess, preMenu, divider, size, align, }: RowActionsKebabProps): import("react").JSX.Element | null;
|
|
19
20
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { FilterNode } from "../../lib/filters";
|
|
1
2
|
export interface ViewItem {
|
|
2
3
|
id: string;
|
|
3
4
|
name: Record<string, string>;
|
|
4
5
|
icon?: string;
|
|
5
6
|
source: "system" | "personal" | "shared";
|
|
6
7
|
is_default?: boolean;
|
|
7
|
-
filters?:
|
|
8
|
+
filters?: FilterNode[];
|
|
8
9
|
columns?: string[];
|
|
9
10
|
sort?: string;
|
|
10
11
|
}
|
|
@@ -1,37 +1,25 @@
|
|
|
1
|
-
import { type AgentConversation, type AgentMessage } from "../api/agents";
|
|
1
|
+
import { type ApprovalScope, type AgentConversation, type AgentMessage, type AgentToolInvocation, type AgentTurn } from "../api/agents";
|
|
2
2
|
export interface AgentTurnState {
|
|
3
|
-
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
params: Record<string, unknown>;
|
|
7
|
-
reason?: string;
|
|
8
|
-
confidence?: number;
|
|
9
|
-
}>;
|
|
10
|
-
elicits: Array<{
|
|
11
|
-
id: string;
|
|
12
|
-
message: string;
|
|
13
|
-
schema: Record<string, unknown>;
|
|
14
|
-
}>;
|
|
3
|
+
streaming: boolean;
|
|
15
4
|
hints: Array<{
|
|
16
5
|
kind: string;
|
|
17
6
|
target?: unknown;
|
|
18
7
|
ttlMs?: number;
|
|
19
8
|
}>;
|
|
20
|
-
streaming: boolean;
|
|
21
|
-
error?: string;
|
|
22
9
|
}
|
|
23
10
|
export declare function useAgentConversation(initialConversationId?: string): {
|
|
24
11
|
conversationId: string | undefined;
|
|
25
12
|
messages: AgentMessage[];
|
|
26
13
|
turn: AgentTurnState;
|
|
14
|
+
turns: AgentTurn[];
|
|
15
|
+
invocations: AgentToolInvocation[];
|
|
27
16
|
conversations: AgentConversation[];
|
|
28
17
|
send: (text: string, context?: Record<string, unknown>) => Promise<void>;
|
|
29
|
-
approve: (invocationId: string,
|
|
18
|
+
approve: (invocationId: string, scope?: ApprovalScope) => Promise<void>;
|
|
30
19
|
reject: (invocationId: string, note?: string) => Promise<void>;
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
submitInput: (invocationId: string, data: Record<string, unknown>) => Promise<void>;
|
|
21
|
+
cancelInput: (invocationId: string) => Promise<void>;
|
|
33
22
|
cancel: () => Promise<void>;
|
|
34
|
-
retry: () => Promise<void>;
|
|
35
23
|
refreshConversations: () => Promise<void>;
|
|
36
24
|
startNew: () => void;
|
|
37
25
|
setConversationId: (id: string | undefined) => void;
|
package/dist-lib/icons.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./DynamicIcon-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./DynamicIcon-Dc2j-rg_.js";
|
|
2
2
|
export { o as DynamicIcon, a as Icon, n as LucideIcon, i as getIcon, t as getIconRegistryVersion, e as setIconRegistry, r as subscribeIconRegistry };
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export type { CustomScreenProps } from "./stores/screen-registry";
|
|
|
43
43
|
export { setIconRegistry, getIcon } from "./stores/icon-registry";
|
|
44
44
|
export type { IconDef } from "./stores/icon-registry";
|
|
45
45
|
export { registerLayoutWidget, getLayoutWidget, hasLayoutWidget, type LayoutWidget, type LayoutWidgetProps, } from "./components/detail-layout/widgets/registry";
|
|
46
|
+
export { useUserLocale } from "./hooks/useUserLocale";
|
|
46
47
|
export { useTabStore, type TabItem, type ReturnTarget } from "./stores/tabs";
|
|
47
48
|
export { useTabNavigate } from "./hooks/useTabNavigate";
|
|
48
49
|
export { useScreenBack } from "./hooks/useScreenBack";
|
|
@@ -129,7 +130,13 @@ export * from "./api/agents";
|
|
|
129
130
|
export { Breadcrumbs } from "./components/shared/Breadcrumbs";
|
|
130
131
|
export type { BreadcrumbsProps, Crumb } from "./components/shared/Breadcrumbs";
|
|
131
132
|
export type { FilterNode, FilterOp } from "./lib/filters";
|
|
132
|
-
export {
|
|
133
|
+
export type { FilterURLState } from "./lib/filters";
|
|
134
|
+
export type { FilterRecord, FilterRecordField, FilterRecordFields } from "./lib/filter-evaluator";
|
|
135
|
+
export { parseFiltersFromURL, parseFilterURLState, setFiltersInURL, hasOrGroups, countActiveFilters, OP_LABELS, NO_VALUE_OPS, } from "./lib/filters";
|
|
136
|
+
export { evaluateFilterTree } from "./lib/filter-evaluator";
|
|
137
|
+
export { resolveEntityVariantCode } from "./lib/variants";
|
|
138
|
+
export { variantActionCodesForRecord, commonVariantActionCodes } from "./lib/variants";
|
|
139
|
+
export { resolveScreenVariantCode, effectiveScreenForRecord } from "./lib/variants";
|
|
133
140
|
export { formatCount, formatExactCount, formatEstimatedCount } from "./lib/format-count";
|
|
134
141
|
export type { MassEditTarget, MassEditTargetKind } from "./lib/mass-edit";
|
|
135
142
|
export { buildMassEditTargets, parseTargetFilter } from "./lib/mass-edit";
|