veryfront 0.1.1122 → 0.1.1123
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/esm/deno.js +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-responses-request-builder.d.ts.map +1 -1
- package/esm/extensions/ext-llm-openai/src/openai-responses-request-builder.js +5 -0
- package/esm/src/agent/hosted/child-lifecycle.d.ts.map +1 -1
- package/esm/src/agent/hosted/child-lifecycle.js +1 -12
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts +38 -0
- package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -0
- package/esm/src/agent/hosted/cloud-agent-chat-execution.js +349 -0
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +80 -0
- package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -0
- package/esm/src/agent/hosted/cloud-agent-child-tools.js +280 -0
- package/esm/src/agent/hosted/cloud-agent-config.d.ts +69 -0
- package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -0
- package/esm/src/agent/hosted/cloud-agent-config.js +129 -0
- package/esm/src/agent/hosted/cloud-agent-paths.d.ts +42 -0
- package/esm/src/agent/hosted/cloud-agent-paths.d.ts.map +1 -0
- package/esm/src/agent/hosted/cloud-agent-paths.js +117 -0
- package/esm/src/agent/hosted/cloud-agent-provider-bootstrap.d.ts +49 -0
- package/esm/src/agent/hosted/cloud-agent-provider-bootstrap.d.ts.map +1 -0
- package/esm/src/agent/hosted/cloud-agent-provider-bootstrap.js +96 -0
- package/esm/src/agent/hosted/durable-child-fork-execution.d.ts.map +1 -1
- package/esm/src/agent/hosted/durable-child-fork-execution.js +1 -12
- package/esm/src/agent/hosted/runtime-request-config.js +2 -2
- package/esm/src/agent/hosted/stream-finalization.d.ts.map +1 -1
- package/esm/src/agent/hosted/stream-finalization.js +2 -26
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts +11 -93
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/hosted/veryfront-cloud-agent-service.js +8 -901
- package/esm/src/agent/project/agent-runtime.d.ts.map +1 -1
- package/esm/src/agent/project/agent-runtime.js +3 -0
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +1 -28
- package/esm/src/agent/streaming/stream-outcome.d.ts +30 -0
- package/esm/src/agent/streaming/stream-outcome.d.ts.map +1 -0
- package/esm/src/agent/streaming/stream-outcome.js +62 -0
- package/esm/src/agent/types.d.ts +3 -0
- package/esm/src/agent/types.d.ts.map +1 -1
- package/esm/src/eval/studio.d.ts +1 -1
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +4 -2
- package/esm/src/modules/server/classify.d.ts +54 -0
- package/esm/src/modules/server/classify.d.ts.map +1 -0
- package/esm/src/modules/server/classify.js +50 -0
- package/esm/src/modules/server/fs-probe.d.ts +14 -0
- package/esm/src/modules/server/fs-probe.d.ts.map +1 -0
- package/esm/src/modules/server/fs-probe.js +17 -0
- package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
- package/esm/src/modules/server/module-batch-handler.js +31 -45
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +77 -93
- package/esm/src/modules/server/module-transform.d.ts +73 -0
- package/esm/src/modules/server/module-transform.d.ts.map +1 -0
- package/esm/src/modules/server/module-transform.js +64 -0
- package/esm/src/modules/server/ssr-import-rewriter.d.ts +1 -1
- package/esm/src/modules/server/ssr-import-rewriter.d.ts.map +1 -1
- package/esm/src/observability/error-collector.d.ts.map +1 -1
- package/esm/src/observability/error-collector.js +4 -11
- package/esm/src/observability/log-buffer.d.ts.map +1 -1
- package/esm/src/observability/log-buffer.js +4 -11
- package/esm/src/observability/request-profiler.d.ts +4 -0
- package/esm/src/observability/request-profiler.d.ts.map +1 -1
- package/esm/src/observability/request-profiler.js +9 -4
- package/esm/src/proxy/server-timing.d.ts.map +1 -1
- package/esm/src/proxy/server-timing.js +2 -14
- package/esm/src/react/components/chat/agent-card.d.ts +2 -3
- package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-card.js +3 -12
- package/esm/src/react/components/chat/agent-picker-context.d.ts +2 -3
- package/esm/src/react/components/chat/agent-picker-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-picker-context.js +3 -13
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +2 -6
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.js +3 -15
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +2 -12
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +3 -21
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/branch-picker.js +2 -11
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.js +2 -11
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-actions.js +2 -11
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.js +2 -11
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts +2 -3
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.js +3 -12
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +2 -3
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +4 -22
- package/esm/src/react/components/chat/chat/components/sources.d.ts +2 -3
- package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sources.js +3 -12
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +2 -6
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/step-indicator.js +3 -15
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +2 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.js +3 -12
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +2 -11
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +2 -2
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/chat-context.js +3 -12
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +2 -2
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.js +3 -12
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +2 -2
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +3 -12
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +2 -2
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.js +3 -12
- package/esm/src/react/components/chat/chat-actions.d.ts +2 -6
- package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-actions.js +3 -15
- package/esm/src/react/components/chat/model-selector.d.ts +2 -6
- package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
- package/esm/src/react/components/chat/model-selector.js +3 -15
- package/esm/src/react/components/create-strict-context.d.ts +44 -0
- package/esm/src/react/components/create-strict-context.d.ts.map +1 -0
- package/esm/src/react/components/create-strict-context.js +56 -0
- package/esm/src/react/components/ui/app-shell.d.ts +2 -2
- package/esm/src/react/components/ui/app-shell.d.ts.map +1 -1
- package/esm/src/react/components/ui/app-shell.js +3 -7
- package/esm/src/react/components/ui/color-mode.d.ts +2 -2
- package/esm/src/react/components/ui/color-mode.d.ts.map +1 -1
- package/esm/src/react/components/ui/color-mode.js +3 -11
- package/esm/src/react/components/ui/command.d.ts.map +1 -1
- package/esm/src/react/components/ui/command.js +2 -7
- package/esm/src/react/components/ui/select.d.ts.map +1 -1
- package/esm/src/react/components/ui/select.js +2 -7
- package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
- package/esm/src/react/components/ui/tabs.js +3 -4
- package/esm/src/runs/schemas.d.ts +9 -9
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +79 -106
- package/esm/src/server/reload-notifier.d.ts +0 -1
- package/esm/src/server/reload-notifier.d.ts.map +1 -1
- package/esm/src/server/reload-notifier.js +7 -25
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
- package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +1 -1
- package/esm/src/utils/base64url.d.ts +9 -1
- package/esm/src/utils/base64url.d.ts.map +1 -1
- package/esm/src/utils/base64url.js +25 -11
- package/esm/src/utils/index.d.ts +2 -1
- package/esm/src/utils/index.d.ts.map +1 -1
- package/esm/src/utils/index.js +2 -1
- package/esm/src/utils/subscriber-set.d.ts +19 -0
- package/esm/src/utils/subscriber-set.d.ts.map +1 -0
- package/esm/src/utils/subscriber-set.js +38 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/claude-code/websocket-publisher.d.ts.map +1 -1
- package/esm/src/workflow/claude-code/websocket-publisher.js +8 -15
- package/esm/src/workflow/schemas/workflow.schema.d.ts +4 -4
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/sources.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,sCAAsC;AACtC,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/sources.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,sCAAsC;AACtC,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzD;AAED,QAAA,MAAuB,UAAU,2BAGhC,CAAC;AACF,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,mBAAmB,GAAG,IAAI,CAE/D;AAED,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;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AC;CACpB;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CACxB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,GACrD,KAAK,CAAC,YAAY,CAkDpB;yBApDe,UAAU;;;AAuD1B;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;CAIlB,CAAC"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { cn } from "../../theme.js";
|
|
3
|
-
import {
|
|
4
|
-
const SourcesContext =
|
|
5
|
-
|
|
6
|
-
export function useSources() {
|
|
7
|
-
const ctx = React.useContext(SourcesContext);
|
|
8
|
-
if (!ctx) {
|
|
9
|
-
throw COMPONENT_ERROR.create({
|
|
10
|
-
detail: "useSources must be used within a Sources",
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
return ctx;
|
|
14
|
-
}
|
|
3
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
4
|
+
const [SourcesContext, useSources] = createStrictContext("useSources", "a Sources");
|
|
5
|
+
export { useSources };
|
|
15
6
|
/**
|
|
16
7
|
* Read the enclosing `Sources` state if present, or `null` outside one. Lets a
|
|
17
8
|
* leaf like `Message.Source` opt into the row's `onSourceClick` without failing
|
|
@@ -18,11 +18,8 @@ export interface StepIndicatorContextValue {
|
|
|
18
18
|
/** Optional override for the complete/pending status glyph. */
|
|
19
19
|
icon?: React.ReactNode;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* `StepIndicator`.
|
|
24
|
-
*/
|
|
25
|
-
export declare function useStepIndicator(): StepIndicatorContextValue;
|
|
21
|
+
declare const useStepIndicator: () => StepIndicatorContextValue;
|
|
22
|
+
export { useStepIndicator };
|
|
26
23
|
/**
|
|
27
24
|
* `StepIndicator.Root` — context provider + the flex container. No children
|
|
28
25
|
* renders the default anatomy (`Rule` + `Label` + `Rule`); pass children to
|
|
@@ -56,5 +53,4 @@ export declare const StepIndicator: typeof StepIndicatorRoot & {
|
|
|
56
53
|
Rule: typeof StepIndicatorRule;
|
|
57
54
|
Label: typeof StepIndicatorLabel;
|
|
58
55
|
};
|
|
59
|
-
export {};
|
|
60
56
|
//# sourceMappingURL=step-indicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-indicator.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/step-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,wCAAwC;AACxC,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAWD,mEAAmE;AACnE,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"step-indicator.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/step-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,wCAAwC;AACxC,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,UAA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} from "../../../ui/icons/index.js";
|
|
4
|
-
import {
|
|
5
|
-
const StepIndicatorContext =
|
|
6
|
-
|
|
7
|
-
* Read the enclosing `StepIndicator` state. Throws when used outside a
|
|
8
|
-
* `StepIndicator`.
|
|
9
|
-
*/
|
|
10
|
-
export function useStepIndicator() {
|
|
11
|
-
const ctx = React.useContext(StepIndicatorContext);
|
|
12
|
-
if (!ctx) {
|
|
13
|
-
throw COMPONENT_ERROR.create({
|
|
14
|
-
detail: "useStepIndicator must be used within a StepIndicator",
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return ctx;
|
|
18
|
-
}
|
|
4
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
5
|
+
const [StepIndicatorContext, useStepIndicator] = createStrictContext("useStepIndicator", "a StepIndicator");
|
|
6
|
+
export { useStepIndicator };
|
|
19
7
|
/**
|
|
20
8
|
* `StepIndicator.Root` — context provider + the flex container. No children
|
|
21
9
|
* renders the default anatomy (`Rule` + `Label` + `Rule`); pass children to
|
|
@@ -27,8 +27,8 @@ export interface ToolCallContextValue {
|
|
|
27
27
|
hasOutput: boolean;
|
|
28
28
|
hasError: boolean;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
export
|
|
30
|
+
declare const useToolCall: () => ToolCallContextValue;
|
|
31
|
+
export { useToolCall };
|
|
32
32
|
/** Props accepted by `ToolCall` / `ToolCall.Root`. */
|
|
33
33
|
export interface ToolCallProps {
|
|
34
34
|
tool: ChatToolPart | ChatDynamicToolPart;
|
|
@@ -114,5 +114,4 @@ export declare const ToolCall: typeof ToolCallRoot & {
|
|
|
114
114
|
Output: typeof ToolCallOutput;
|
|
115
115
|
Error: typeof ToolCallError;
|
|
116
116
|
};
|
|
117
|
-
export {};
|
|
118
117
|
//# sourceMappingURL=tool-ui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-ui.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/tool-ui.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAyD7F,gCAAgC;AAChC,wBAAgB,eAAe,CAC7B,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1D,KAAK,CAAC,GAAG,CAAC,OAAO,CAcnB;AA+FD;;;;;;;;;GASG;AAYH,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,GAAG,mBAAmB,CAAC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"tool-ui.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/components/tool-ui.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAyD7F,gCAAgC;AAChC,wBAAgB,eAAe,CAC7B,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1D,KAAK,CAAC,GAAG,CAAC,OAAO,CAcnB;AA+FD;;;;;;;;;GASG;AAYH,yDAAyD;AACzD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,GAAG,mBAAmB,CAAC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,C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
import { Alert, AlertContent, AlertIcon } from "../../../ui/alert.js";
|
|
9
|
-
import {
|
|
9
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
10
10
|
import { escapeHtml } from "../../../../../utils/html-escape.js";
|
|
11
11
|
import { isSkillToolPart } from "../utils/message-parts.js";
|
|
12
12
|
import { getSkillToolProps, SkillTool } from "./skill-tool.js";
|
|
@@ -110,17 +110,8 @@ function renderOutputAsTable(output) {
|
|
|
110
110
|
function hasVisibleToolOutput(output) {
|
|
111
111
|
return output !== undefined && output !== null;
|
|
112
112
|
}
|
|
113
|
-
const ToolCallContext =
|
|
114
|
-
|
|
115
|
-
export function useToolCall() {
|
|
116
|
-
const ctx = React.useContext(ToolCallContext);
|
|
117
|
-
if (!ctx) {
|
|
118
|
-
throw COMPONENT_ERROR.create({
|
|
119
|
-
detail: "useToolCall must be used within a ToolCall",
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return ctx;
|
|
123
|
-
}
|
|
113
|
+
const [ToolCallContext, useToolCall] = createStrictContext("useToolCall", "a ToolCall");
|
|
114
|
+
export { useToolCall };
|
|
124
115
|
/**
|
|
125
116
|
* `ToolCall.Root` — context provider + the card wrapper. No children renders
|
|
126
117
|
* the default anatomy (`Trigger` + `Body`); pass children to recompose. Skill /
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-message-list.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAOvE,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAGlB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qFAAqF;IACrF,kBAAkB,CAAC,EAAE,CACnB,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,IAAI,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,KAC/C,KAAK,CAAC,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,aAAa,CAAC,EAAE,aAAa,CAAC;IAG9B,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAElE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"chat-message-list.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-message-list.tsx"],"names":[],"mappings":"AA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ElE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAsBD,wDAAwD;AACxD,MAAM,WAAW,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvF,uCAAuC;IACvC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,qFAAqF;AACrF,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,2BAA2B,GAAG,KAAK,CAAC,YAAY,CAuDlD;kBA5DQ,sBAAsB;;;AA+D/B,gCAAgC;AAChC,iBAAS,mBAAmB,CAC1B,EACE,QAAQ,EACR,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,aAAa,EAAE,cAAc,EAC7B,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,QAAQ,EACR,GAAG,GACJ,EAAE,oBAAoB,GACtB,KAAK,CAAC,YAAY,CAgGpB;kBAhHQ,mBAAmB;;;AAmH5B,gFAAgF;AAChF,eAAO,MAAM,eAAe;;CAE1B,CAAC"}
|
|
@@ -11,20 +11,11 @@ import * as React from "react";
|
|
|
11
11
|
import { MessageList } from "../../../../primitives/index.js";
|
|
12
12
|
import { cn } from "../../theme.js";
|
|
13
13
|
import { useStickToBottom } from "../hooks/use-stick-to-bottom.js";
|
|
14
|
-
import {
|
|
14
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
15
15
|
import { PendingMessage } from "./pending-message.js";
|
|
16
16
|
import { Message } from "./message.js";
|
|
17
17
|
import { useChatContextOptional } from "../contexts/chat-context.js";
|
|
18
|
-
const ChatMessageListContext =
|
|
19
|
-
function useChatMessageList() {
|
|
20
|
-
const context = React.useContext(ChatMessageListContext);
|
|
21
|
-
if (!context) {
|
|
22
|
-
throw COMPONENT_ERROR.create({
|
|
23
|
-
detail: "ChatMessageList.Content must be used within a ChatMessageList",
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return context;
|
|
27
|
-
}
|
|
18
|
+
const [ChatMessageListContext, useChatMessageList] = createStrictContext("ChatMessageList.Content", "a ChatMessageList");
|
|
28
19
|
/** Centered transcript column. Compose this part to style or replace its anatomy. */
|
|
29
20
|
function ChatMessageListContent({ className, children, ref, ...props }) {
|
|
30
21
|
const { messages, isLoading, renderMessage, onSourceClick, editMessage, getBranches, switchBranch, onFeedback, contentRef, lastMessage, } = useChatMessageList();
|
|
@@ -51,10 +51,10 @@ export interface ChatContextValue {
|
|
|
51
51
|
scrollToBottom: () => void;
|
|
52
52
|
theme: ChatTheme;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
export declare function useChatContext(): ChatContextValue;
|
|
54
|
+
declare const useChatContext: () => ChatContextValue;
|
|
56
55
|
/** React hook for chat context optional. */
|
|
57
56
|
export declare function useChatContextOptional(): ChatContextValue | null;
|
|
58
57
|
/** Render chat context provider. */
|
|
59
58
|
export declare const ChatContextProvider: any;
|
|
59
|
+
export { useChatContext };
|
|
60
60
|
//# sourceMappingURL=chat-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/chat-context.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,c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AE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;IAChD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAGlE,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGxD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,IAAI,CAAC;IAG3B,KAAK,EAAE,SAAS,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"chat-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/chat-context.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEtE,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAE/B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAA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AI,CAAC;IAGlE,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGxD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,IAAI,CAAC;IAG3B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,QAAA,MAAoB,cAAc,wBAGjC,CAAC;AAEF,4CAA4C;AAC5C,wBAAgB,sBAAsB,IAAI,gBAAgB,GAAG,IAAI,CAEhE;AAED,oCAAoC;AACpC,eAAO,MAAM,mBAAmB,KAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -6,21 +6,12 @@
|
|
|
6
6
|
* @module react/components/chat/contexts/chat-context
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import {
|
|
10
|
-
const ChatContext =
|
|
11
|
-
/** Context for use chat. */
|
|
12
|
-
export function useChatContext() {
|
|
13
|
-
const context = React.useContext(ChatContext);
|
|
14
|
-
if (!context) {
|
|
15
|
-
throw COMPONENT_ERROR.create({
|
|
16
|
-
detail: "useChatContext must be used within a ChatRoot or Chat component",
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return context;
|
|
20
|
-
}
|
|
9
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
10
|
+
const [ChatContext, useChatContext] = createStrictContext("useChatContext", "a ChatRoot or Chat component");
|
|
21
11
|
/** React hook for chat context optional. */
|
|
22
12
|
export function useChatContextOptional() {
|
|
23
13
|
return React.useContext(ChatContext);
|
|
24
14
|
}
|
|
25
15
|
/** Render chat context provider. */
|
|
26
16
|
export const ChatContextProvider = ChatContext.Provider;
|
|
17
|
+
export { useChatContext };
|
|
@@ -30,10 +30,10 @@ export interface ComposerContextValue {
|
|
|
30
30
|
models: ModelOption[];
|
|
31
31
|
onModelChange?: (modelId: string) => void;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
export declare function useComposerContext(): ComposerContextValue;
|
|
33
|
+
declare const useComposerContext: () => ComposerContextValue;
|
|
35
34
|
/** React hook for composer context optional. */
|
|
36
35
|
export declare function useComposerContextOptional(): ComposerContextValue | null;
|
|
37
36
|
/** Render composer context provider. */
|
|
38
37
|
export declare const ComposerContextProvider: any;
|
|
38
|
+
export { useComposerContext };
|
|
39
39
|
//# sourceMappingURL=composer-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/composer-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IAEnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAGjF,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IAGnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAGpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;
|
|
1
|
+
{"version":3,"file":"composer-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/composer-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IAEnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAGjF,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IAGnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAGpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,QAAA,MAAwB,kBAAkB,4BAGzC,CAAC;AAEF,gDAAgD;AAChD,wBAAgB,0BAA0B,IAAI,oBAAoB,GAAG,IAAI,CAExE;AAED,wCAAwC;AACxC,eAAO,MAAM,uBAAuB,KAA2B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -7,21 +7,12 @@
|
|
|
7
7
|
* @module react/components/chat/contexts/composer-context
|
|
8
8
|
*/
|
|
9
9
|
import * as React from "react";
|
|
10
|
-
import {
|
|
11
|
-
const ComposerContext =
|
|
12
|
-
/** Context for use composer. */
|
|
13
|
-
export function useComposerContext() {
|
|
14
|
-
const context = React.useContext(ComposerContext);
|
|
15
|
-
if (!context) {
|
|
16
|
-
throw COMPONENT_ERROR.create({
|
|
17
|
-
detail: "useComposerContext must be used within a Composer or Chat component",
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return context;
|
|
21
|
-
}
|
|
10
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
11
|
+
const [ComposerContext, useComposerContext] = createStrictContext("useComposerContext", "a Composer or Chat component");
|
|
22
12
|
/** React hook for composer context optional. */
|
|
23
13
|
export function useComposerContextOptional() {
|
|
24
14
|
return React.useContext(ComposerContext);
|
|
25
15
|
}
|
|
26
16
|
/** Render composer context provider. */
|
|
27
17
|
export const ComposerContextProvider = ComposerContext.Provider;
|
|
18
|
+
export { useComposerContext };
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { type UseConversationsOptions, type UseConversationsResult } from "../hooks/use-conversations.js";
|
|
12
|
-
|
|
13
|
-
export declare function useConversationsContext(): UseConversationsResult;
|
|
12
|
+
declare const useConversationsContext: () => UseConversationsResult;
|
|
14
13
|
/** Read the shared conversations state, or `null` when there is no provider. */
|
|
15
14
|
export declare function useConversationsContextOptional(): UseConversationsResult | null;
|
|
15
|
+
export { useConversationsContext };
|
|
16
16
|
/** Low-level context provider (value supplied by the caller). */
|
|
17
17
|
export declare const ConversationsContextProvider: any;
|
|
18
18
|
/** Props accepted by {@link ConversationsProvider}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/conversations-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"conversations-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/conversations-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AAEvC,QAAA,MAA6B,uBAAuB,8BAGnD,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,+BAA+B,IAAI,sBAAsB,GAAG,IAAI,CAE/E;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,iEAAiE;AACjE,eAAO,MAAM,4BAA4B,KAAgC,CAAC;AAE1E,uDAAuD;AACvD,MAAM,WAAW,0BAA2B,SAAQ,uBAAuB;IACzE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,EAAE,0BAA0B,GACnD,KAAK,CAAC,YAAY,CAOpB"}
|
|
@@ -8,23 +8,14 @@
|
|
|
8
8
|
* @module react/components/chat/contexts/conversations-context
|
|
9
9
|
*/
|
|
10
10
|
import * as React from "react";
|
|
11
|
-
import {
|
|
11
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
12
12
|
import { useConversations, } from "../hooks/use-conversations.js";
|
|
13
|
-
const ConversationsContext =
|
|
14
|
-
/** Read the shared conversations state. Throws when used outside a provider. */
|
|
15
|
-
export function useConversationsContext() {
|
|
16
|
-
const context = React.useContext(ConversationsContext);
|
|
17
|
-
if (!context) {
|
|
18
|
-
throw COMPONENT_ERROR.create({
|
|
19
|
-
detail: "useConversationsContext must be used within a ConversationsProvider",
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return context;
|
|
23
|
-
}
|
|
13
|
+
const [ConversationsContext, useConversationsContext] = createStrictContext("useConversationsContext", "a ConversationsProvider");
|
|
24
14
|
/** Read the shared conversations state, or `null` when there is no provider. */
|
|
25
15
|
export function useConversationsContextOptional() {
|
|
26
16
|
return React.useContext(ConversationsContext);
|
|
27
17
|
}
|
|
18
|
+
export { useConversationsContext };
|
|
28
19
|
/** Low-level context provider (value supplied by the caller). */
|
|
29
20
|
export const ConversationsContextProvider = ConversationsContext.Provider;
|
|
30
21
|
/**
|
|
@@ -27,10 +27,10 @@ export interface MessageContextValue {
|
|
|
27
27
|
onFeedback?: (value: FeedbackValue) => void;
|
|
28
28
|
feedback?: FeedbackValue | null;
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
export declare function useMessageContext(): MessageContextValue;
|
|
30
|
+
declare const useMessageContext: () => MessageContextValue;
|
|
32
31
|
/** React hook for message context optional. */
|
|
33
32
|
export declare function useMessageContextOptional(): MessageContextValue | null;
|
|
33
|
+
export { useMessageContext };
|
|
34
34
|
/** The message's grouped parts exposed as headless data. */
|
|
35
35
|
export interface MessagePartsData {
|
|
36
36
|
/** Parts grouped in render order (text / reasoning / tool / source …). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/message-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IAGpB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAG1B,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,mFAAmF;IACnF,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"message-context.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/contexts/message-context.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAI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BAAgB,CAGlD;AAED,uCAAuC;AACvC,eAAO,MAAM,sBAAsB,KAA0B,CAAC"}
|
|
@@ -7,22 +7,13 @@
|
|
|
7
7
|
* @module react/components/chat/contexts/message-context
|
|
8
8
|
*/
|
|
9
9
|
import * as React from "react";
|
|
10
|
-
import {
|
|
11
|
-
const MessageContext =
|
|
12
|
-
/** Context for use message. */
|
|
13
|
-
export function useMessageContext() {
|
|
14
|
-
const context = React.useContext(MessageContext);
|
|
15
|
-
if (!context) {
|
|
16
|
-
throw COMPONENT_ERROR.create({
|
|
17
|
-
detail: "useMessageContext must be used within a Message component",
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return context;
|
|
21
|
-
}
|
|
10
|
+
import { createStrictContext } from "../../../create-strict-context.js";
|
|
11
|
+
const [MessageContext, useMessageContext] = createStrictContext("useMessageContext", "a Message component");
|
|
22
12
|
/** React hook for message context optional. */
|
|
23
13
|
export function useMessageContextOptional() {
|
|
24
14
|
return React.useContext(MessageContext);
|
|
25
15
|
}
|
|
16
|
+
export { useMessageContext };
|
|
26
17
|
/**
|
|
27
18
|
* `useMessageParts` — read the current message's parts as data, so a consumer
|
|
28
19
|
* can render them however they like (the headless access point to parts;
|
|
@@ -90,11 +90,8 @@ export interface ChatActionsContextValue {
|
|
|
90
90
|
/** The settings submenu config, if any. */
|
|
91
91
|
settings?: ChatActionsSettings;
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* `ChatActions` — a misplaced sub-part is a loud error, never a silent null.
|
|
96
|
-
*/
|
|
97
|
-
export declare function useChatActions(): ChatActionsContextValue;
|
|
93
|
+
declare const useChatActions: () => ChatActionsContextValue;
|
|
94
|
+
export { useChatActions };
|
|
98
95
|
/**
|
|
99
96
|
* `ChatActions.Root` — the `DropdownMenu` wrapper + context provider. No
|
|
100
97
|
* children renders the default preset (`Trigger` + `Content` with the attach
|
|
@@ -182,5 +179,4 @@ export declare const ChatActions: typeof ChatActionsRoot & {
|
|
|
182
179
|
Item: typeof ChatActionsItem;
|
|
183
180
|
Preset: typeof ChatActionsPreset;
|
|
184
181
|
};
|
|
185
|
-
export {};
|
|
186
182
|
//# sourceMappingURL=chat-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-actions.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/chat-actions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqE/B,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,UAAU,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,aAAa,EAAE,OAAO,CAAC;IACvB,oEAAoE;IACpE,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,mEAAmE;IACnE,qBAAqB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACjD;AA+HD,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,kBAAkB;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oBAAoB;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mDAAmD;IACnD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qDAAqD;IACrD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAgBD,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,uEAAuE;IACvE,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,kDAAkD;IAClD,gBAAgB,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"chat-actions.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/chat-actions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqE/B,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,UAAU,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,aAAa,EAAE,OAAO,CAAC;IACvB,oEAAoE;IACpE,kBAAkB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,mEAAmE;IACnE,qBAAqB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACjD;AA+HD,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,kBAAkB;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oBAAoB;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC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AQ,EAAE,SAAS,EAAE,EAAE,oBAAoB,GAC7E,KAAK,CAAC,YAAY,CAYpB;kBAdQ,eAAe;;;AAiBxB;;;;;GAKG;AACH,iBAAS,iBAAiB,IAAI,KAAK,CAAC,YAAY,CAiC/C;kBAjCQ,iBAAiB;;;AAoC1B;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;CAMtB,CAAC"}
|
|
@@ -27,7 +27,7 @@ import { Switch } from "../ui/switch.js";
|
|
|
27
27
|
import { Floating } from "../ui/floating.js";
|
|
28
28
|
import { Button } from "../ui/button.js";
|
|
29
29
|
import { PaperclipIcon, PlusIcon } from "../ui/icons/index.js";
|
|
30
|
-
import {
|
|
30
|
+
import { createStrictContext } from "../create-strict-context.js";
|
|
31
31
|
/* -------------------------------------------------------------------------------------------------
|
|
32
32
|
* Inlined icons — Figma / Settings / ChevronRight are not in the shared icons
|
|
33
33
|
* barrel; kept local so this component adds no shared-file edits. Match the
|
|
@@ -95,20 +95,8 @@ function SettingsSubmenu({ settings, }) {
|
|
|
95
95
|
React.createElement(SettingsToggleRow, { label: "Auto-send queue", checked: settings.autoSubmit, onCheckedChange: settings.onAutoSubmitChange }),
|
|
96
96
|
React.createElement(SettingsToggleRow, { label: "Autofix errors", checked: settings.autoFixErrors, onCheckedChange: settings.onAutoFixErrorsChange }))));
|
|
97
97
|
}
|
|
98
|
-
const ChatActionsContext =
|
|
99
|
-
|
|
100
|
-
* Read the enclosing `ChatActions` state. Throws when used outside a
|
|
101
|
-
* `ChatActions` — a misplaced sub-part is a loud error, never a silent null.
|
|
102
|
-
*/
|
|
103
|
-
export function useChatActions() {
|
|
104
|
-
const ctx = React.useContext(ChatActionsContext);
|
|
105
|
-
if (!ctx) {
|
|
106
|
-
throw COMPONENT_ERROR.create({
|
|
107
|
-
detail: "useChatActions must be used within a ChatActions",
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
return ctx;
|
|
111
|
-
}
|
|
98
|
+
const [ChatActionsContext, useChatActions] = createStrictContext("useChatActions", "a ChatActions");
|
|
99
|
+
export { useChatActions };
|
|
112
100
|
/**
|
|
113
101
|
* `ChatActions.Root` — the `DropdownMenu` wrapper + context provider. No
|
|
114
102
|
* children renders the default preset (`Trigger` + `Content` with the attach
|
|
@@ -70,11 +70,8 @@ export interface ModelSelectorContextValue {
|
|
|
70
70
|
/** Whether the selector is disabled. */
|
|
71
71
|
disabled?: boolean;
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
* outside a `<ModelSelector>`.
|
|
76
|
-
*/
|
|
77
|
-
export declare function useModelSelector(): ModelSelectorContextValue;
|
|
73
|
+
declare const useModelSelector: () => ModelSelectorContextValue;
|
|
74
|
+
export { useModelSelector };
|
|
78
75
|
/** Props for `ModelSelector.Trigger` — the pill/icon combobox button. */
|
|
79
76
|
export interface ModelSelectorTriggerProps {
|
|
80
77
|
/** Trigger style. @default "pill" */
|
|
@@ -152,5 +149,4 @@ export declare const ModelSelector: typeof ModelSelectorRoot & {
|
|
|
152
149
|
List: typeof ModelSelectorList;
|
|
153
150
|
Item: typeof ModelSelectorItem;
|
|
154
151
|
};
|
|
155
|
-
export {};
|
|
156
152
|
//# sourceMappingURL=model-selector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-selector.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/model-selector.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4C/B,sDAAsD;AACtD,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,uBAAuB;IACvB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,CACX,OAAO,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAC1C,KAAK,CAAC,SAAS,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAwCD,4EAA4E;AAC5E,MAAM,WAAW,yBAAyB;IACxC,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,sDAAsD;IACtD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,0BAA0B;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,kCAAkC;IAClC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"model-selector.d.ts","sourceRoot":"","sources":["../../../../../src/src/react/components/chat/model-selector.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4C/B,sDAAsD;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CAAC,EAAE,MAAM,CAAA;CAAE,GAC1E,KAAK,CAAC,YAAY,CAMpB;kBARQ,iBAAiB;;;AAW1B,sEAAsE;AACtE,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,KAAK,EAAE,WAAW,CAAC;IACnB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2EAA2E;AAC3E,iBAAS,iBAAiB,CACxB,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,sBAAsB,GACrD,KAAK,CAAC,YAAY,CAoBpB;kBAtBQ,iBAAiB;;;AA6E1B;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,EACzB,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAgB,EAChB,UAAU,EACV,QAAQ,GACT,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CA6CzC;kBAtDQ,iBAAiB;;;AAyD1B;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;CAOxB,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, Command
|
|
|
15
15
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
|
|
16
16
|
import { Pill } from "../ui/pill.js";
|
|
17
17
|
import { CheckIcon, ChevronDownIcon, SparklesIcon } from "../ui/icons/index.js";
|
|
18
|
-
import {
|
|
18
|
+
import { createStrictContext } from "../create-strict-context.js";
|
|
19
19
|
/** Provider slug for a model (explicit `provider`, else the `value` prefix). */
|
|
20
20
|
function providerOf(model) {
|
|
21
21
|
return model?.provider ?? model?.value.split("/")[0];
|
|
@@ -48,20 +48,8 @@ function groupByProvider(models) {
|
|
|
48
48
|
}
|
|
49
49
|
return groups;
|
|
50
50
|
}
|
|
51
|
-
const ModelSelectorContext =
|
|
52
|
-
|
|
53
|
-
* Read the enclosing `ModelSelector` selection + open state. Throws when used
|
|
54
|
-
* outside a `<ModelSelector>`.
|
|
55
|
-
*/
|
|
56
|
-
export function useModelSelector() {
|
|
57
|
-
const ctx = React.useContext(ModelSelectorContext);
|
|
58
|
-
if (!ctx) {
|
|
59
|
-
throw COMPONENT_ERROR.create({
|
|
60
|
-
detail: "useModelSelector must be used within a ModelSelector",
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return ctx;
|
|
64
|
-
}
|
|
51
|
+
const [ModelSelectorContext, useModelSelector] = createStrictContext("useModelSelector", "a ModelSelector");
|
|
52
|
+
export { useModelSelector };
|
|
65
53
|
/** The pill (or icon) combobox trigger. Toggles the popover. */
|
|
66
54
|
function ModelSelectorTrigger({ variant = "pill", children, className }) {
|
|
67
55
|
const { selectedModel, disabled } = useModelSelector();
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createStrictContext: factory for React context + strict-use hook pairs.
|
|
3
|
+
*
|
|
4
|
+
* Eliminates the repeated "read context, throw if missing" pattern across
|
|
5
|
+
* `chat/` and `ui/` components. Every compound component that wraps a
|
|
6
|
+
* `React.Context<T | null>` and exposes a throwing hook can use this factory
|
|
7
|
+
* instead of hand-writing the same 9-line block.
|
|
8
|
+
*
|
|
9
|
+
* @module react/components/create-strict-context
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
/**
|
|
13
|
+
* Create a `React.Context<T | null>` together with a hook that throws a
|
|
14
|
+
* `COMPONENT_ERROR` when the context is absent.
|
|
15
|
+
*
|
|
16
|
+
* @param hookName Subject phrase used in the error detail, e.g. `"useFoo"` or
|
|
17
|
+
* `"Foo parts"`. Combined as: `"${hookName} must be used within ${parentHint}"`.
|
|
18
|
+
* @param parentHint Completion of "…must be used within …", e.g. `"a <FooProvider>"`.
|
|
19
|
+
* @returns Readonly tuple `[Context, useStrictHook]`.
|
|
20
|
+
* - `Context`: the raw `React.Context`. Expose its `.Provider` via a named
|
|
21
|
+
* alias (e.g. `export const FooProvider = FooContext.Provider`). Pass the
|
|
22
|
+
* context value through a memoised variable to satisfy the inline-context
|
|
23
|
+
* lint ratchet.
|
|
24
|
+
* - `useStrictHook`: throws `COMPONENT_ERROR` when called outside a provider.
|
|
25
|
+
* Export it under the canonical hook name (e.g. `export { useStrictHook as useFoo }`
|
|
26
|
+
* or rename directly in the destructuring).
|
|
27
|
+
*
|
|
28
|
+
* Optional read path: where a `null`-returning variant is needed, write a
|
|
29
|
+
* three-line wrapper, `return React.useContext(FooContext)`, using the
|
|
30
|
+
* returned `Context` directly. This keeps the factory focused on the one
|
|
31
|
+
* repeated pattern without bloating its API.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const [FooContext, useFoo] = createStrictContext<FooContextValue>(
|
|
36
|
+
* "useFoo",
|
|
37
|
+
* "a <FooProvider>",
|
|
38
|
+
* );
|
|
39
|
+
* export const FooContextProvider = FooContext.Provider;
|
|
40
|
+
* export { useFoo };
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function createStrictContext<T>(hookName: string, parentHint: string): readonly [React.Context<T | null>, () => T];
|
|
44
|
+
//# sourceMappingURL=create-strict-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-strict-context.d.ts","sourceRoot":"","sources":["../../../../src/src/react/components/create-strict-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAY7C"}
|