akanjs 3.0.0-alpha.2 → 3.0.0-alpha.21
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/README.ko.md +1 -1
- package/README.md +1 -1
- package/base/symbols.ts +4 -0
- package/client/clientRuntime.ts +8 -0
- package/client/cn.ts +7 -0
- package/client/csrTypes.ts +2 -0
- package/client/frameDebug.ts +3 -2
- package/common/Logger.ts +4 -0
- package/common/deepObjectify.ts +21 -7
- package/common/index.ts +14 -0
- package/common/mcpExposure.ts +99 -0
- package/common/pathSet.ts +17 -5
- package/common/routeConvention.ts +30 -0
- package/constant/crystalize.ts +3 -1
- package/constant/fieldInfo.ts +6 -0
- package/constant/getDefault.ts +37 -9
- package/constant/immerify.ts +1 -1
- package/constant/index.ts +2 -0
- package/constant/labelOf.ts +17 -0
- package/constant/mask.ts +60 -0
- package/constant/purify.ts +17 -11
- package/constant/types.ts +14 -12
- package/dictionary/DictionaryLookup.ts +30 -0
- package/dictionary/agent.dictionary.ts +31 -0
- package/dictionary/agentTurn.dictionary.ts +29 -0
- package/dictionary/base.dictionary.ts +8 -0
- package/dictionary/dictInfo.ts +8 -0
- package/dictionary/dictionary.ts +9 -3
- package/dictionary/index.ts +1 -0
- package/document/database.ts +21 -0
- package/document/filterMeta.ts +7 -0
- package/document/index.ts +1 -0
- package/document/into.ts +7 -1
- package/document/noDocumentError.ts +12 -0
- package/fetch/agentTurn.ts +19 -0
- package/fetch/client/fetchClient.ts +71 -13
- package/fetch/client/wsClient.ts +17 -2
- package/fetch/fetchType/endpointFetch.type.ts +10 -4
- package/fetch/index.ts +1 -0
- package/local/apps/serverLifecycle/serverLifecycle-local.db +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local.db-shm +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local.db-wal +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local_solid.db +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-shm +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-wal +0 -0
- package/package.json +11 -9
- package/server/akanApp.ts +30 -34
- package/server/akanOption.ts +65 -7
- package/server/akanServer.ts +172 -7
- package/server/animatedImage.ts +83 -0
- package/server/artifact/routeClientCache.ts +14 -0
- package/server/assetEncoding.ts +47 -0
- package/server/devtools/signalSerializer.ts +2 -2
- package/server/devtools/types.ts +2 -2
- package/server/di/diLifecycle.ts +31 -3
- package/server/di/predefinedAdaptor.ts +6 -0
- package/server/imageOptimizer.ts +33 -46
- package/server/index.ts +1 -2
- package/server/mcp/McpAuth.ts +177 -0
- package/server/mcp/McpDispatcher.ts +245 -0
- package/server/mcp/McpEventStream.ts +76 -0
- package/server/mcp/McpExecutionContext.ts +105 -0
- package/server/mcp/McpRouter.ts +591 -0
- package/server/mcp/index.ts +5 -0
- package/server/resolver/CascadeRunner.ts +1 -1
- package/server/resolver/database.resolver.ts +42 -5
- package/server/resolver/service.resolver.ts +29 -0
- package/server/resolver/signal.resolver.ts +16 -1
- package/server/routeTreeBuilder.ts +2 -44
- package/server/rscWorker.tsx +6 -2
- package/server/subRouteIndexDocument.tsx +61 -0
- package/server/systemPageDocument.tsx +2 -2
- package/server/systemPages.tsx +49 -16
- package/server/vendor/akanjs-fetch.ts +1 -0
- package/server/webRouter.ts +159 -35
- package/service/agent.service.ts +14 -0
- package/service/base.service.ts +2 -1
- package/service/index.ts +1 -0
- package/service/predefinedAdaptor/database.adaptor.ts +78 -24
- package/service/predefinedAdaptor/deepseekLlm.ts +230 -0
- package/service/predefinedAdaptor/index.ts +3 -0
- package/service/predefinedAdaptor/insightQuery.ts +183 -0
- package/service/predefinedAdaptor/llm.adaptor.ts +76 -0
- package/service/predefinedAdaptor/role.adaptor.ts +2 -0
- package/service/predefinedAdaptor/schedule.adaptor.ts +12 -5
- package/service/serviceModule.ts +17 -0
- package/service/types.ts +4 -0
- package/signal/agent/AgentCatalogue.ts +165 -0
- package/signal/agent/index.ts +1 -0
- package/signal/agent.signal.ts +42 -0
- package/signal/agentTurn.ts +8 -0
- package/signal/agentTurnStream.ts +48 -0
- package/signal/base.signal.ts +2 -1
- package/signal/endpointInfo.ts +38 -2
- package/signal/guard.ts +13 -1
- package/signal/guards.ts +52 -1
- package/signal/index.ts +6 -0
- package/signal/mcp/McpDocument.ts +286 -0
- package/signal/mcp/McpProgress.ts +106 -0
- package/signal/mcp/McpUriTemplate.ts +85 -0
- package/signal/mcp/Msg.ts +368 -0
- package/signal/mcp/index.ts +5 -0
- package/signal/mcp/mcpProtocol.ts +120 -0
- package/signal/middleware.ts +7 -3
- package/signal/openapi/openapi.ts +32 -171
- package/signal/schema/JsonSchemaBuilder.ts +211 -0
- package/signal/schema/index.ts +1 -0
- package/signal/signalContext.ts +85 -9
- package/signal/slice.ts +9 -9
- package/signal/types.ts +1 -1
- package/store/action.ts +11 -22
- package/store/actionTag.ts +33 -0
- package/store/agent/AgentBridge.ts +323 -0
- package/store/agent/AgentContext.ts +74 -0
- package/store/agent/AgentPrompts.ts +82 -0
- package/store/agent/AgentVisibility.ts +68 -0
- package/store/agent/ScreenReader.ts +208 -0
- package/store/agent/StoreCatalogue.ts +351 -0
- package/store/agent/StoreSurfaceSource.ts +122 -0
- package/store/agent/index.ts +9 -0
- package/store/agent/storeSurface.ts +28 -0
- package/store/agent/types.ts +50 -0
- package/store/agentic/StToolBuilder.ts +199 -0
- package/store/agentic/attachAgentic.ts +22 -0
- package/store/agentic/index.ts +5 -0
- package/store/agentic/readableValue.ts +17 -0
- package/store/agentic/useStExpose.ts +18 -0
- package/store/agentic/useStState.ts +35 -0
- package/store/baseSt.ts +7 -0
- package/store/databaseStateNames.ts +31 -0
- package/store/formSetterNames.ts +21 -0
- package/store/index.ts +8 -0
- package/store/rootStore.ts +3 -1
- package/store/sliceRole.ts +36 -0
- package/store/state.ts +2 -12
- package/store/store.ts +19 -1
- package/store/storeInstance.ts +165 -20
- package/store/storeRegistry.ts +16 -1
- package/store/types.ts +18 -0
- package/store/withSelector.ts +7 -8
- package/test/registerDom.ts +4 -0
- package/types/base/symbols.d.ts +4 -0
- package/types/client/cn.d.ts +5 -0
- package/types/client/csrTypes.d.ts +2 -0
- package/types/common/Logger.d.ts +2 -0
- package/types/common/deepObjectify.d.ts +4 -2
- package/types/common/index.d.ts +2 -1
- package/types/common/mcpExposure.d.ts +60 -0
- package/types/common/routeConvention.d.ts +8 -0
- package/types/constant/fieldInfo.d.ts +1 -0
- package/types/constant/getDefault.d.ts +5 -0
- package/types/constant/index.d.ts +2 -0
- package/types/constant/labelOf.d.ts +6 -0
- package/types/constant/mask.d.ts +34 -0
- package/types/constant/purify.d.ts +2 -2
- package/types/constant/types.d.ts +2 -2
- package/types/dictionary/DictionaryLookup.d.ts +14 -0
- package/types/dictionary/agent.dictionary.d.ts +1 -0
- package/types/dictionary/agentTurn.dictionary.d.ts +1 -0
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictInfo.d.ts +6 -0
- package/types/dictionary/dictionary.d.ts +11 -9
- package/types/dictionary/index.d.ts +1 -0
- package/types/document/database.d.ts +20 -0
- package/types/document/filterMeta.d.ts +1 -0
- package/types/document/index.d.ts +1 -0
- package/types/document/into.d.ts +6 -1
- package/types/document/noDocumentError.d.ts +12 -0
- package/types/fetch/agentTurn.d.ts +593 -0
- package/types/fetch/client/fetchClient.d.ts +10 -0
- package/types/fetch/fetchType/endpointFetch.type.d.ts +5 -3
- package/types/fetch/index.d.ts +1 -0
- package/types/server/akanOption.d.ts +35 -7
- package/types/server/akanServer.d.ts +44 -1
- package/types/server/animatedImage.d.ts +7 -0
- package/types/server/artifact/routeClientCache.d.ts +6 -0
- package/types/server/assetEncoding.d.ts +7 -0
- package/types/server/devtools/types.d.ts +2 -2
- package/types/server/di/predefinedAdaptor.d.ts +4 -1
- package/types/server/index.d.ts +0 -2
- package/types/server/mcp/McpAuth.d.ts +62 -0
- package/types/server/mcp/McpDispatcher.d.ts +54 -0
- package/types/server/mcp/McpEventStream.d.ts +18 -0
- package/types/server/mcp/McpExecutionContext.d.ts +44 -0
- package/types/server/mcp/McpRouter.d.ts +60 -0
- package/types/server/mcp/index.d.ts +5 -0
- package/types/server/mcp.d.ts +1 -0
- package/types/server/subRouteIndexDocument.d.ts +8 -0
- package/types/server/systemPageDocument.d.ts +1 -0
- package/types/server/systemPages.d.ts +5 -0
- package/types/server/vendor/akanjs-fetch.d.ts +1 -0
- package/types/service/agent.service.d.ts +12 -0
- package/types/service/base.service.d.ts +4 -0
- package/types/service/index.d.ts +1 -0
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +24 -2
- package/types/service/predefinedAdaptor/deepseekLlm.d.ts +64 -0
- package/types/service/predefinedAdaptor/index.d.ts +3 -0
- package/types/service/predefinedAdaptor/insightQuery.d.ts +50 -0
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +68 -0
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +2 -0
- package/types/service/predefinedAdaptor/schedule.adaptor.d.ts +10 -6
- package/types/service/types.d.ts +4 -1
- package/types/signal/agent/AgentCatalogue.d.ts +100 -0
- package/types/signal/agent/index.d.ts +1 -0
- package/types/signal/agent.d.ts +1 -0
- package/types/signal/agent.signal.d.ts +29 -0
- package/types/signal/agentTurn.d.ts +9 -0
- package/types/signal/agentTurnStream.d.ts +16 -0
- package/types/signal/base.signal.d.ts +1 -1
- package/types/signal/endpointInfo.d.ts +21 -3
- package/types/signal/guard.d.ts +11 -0
- package/types/signal/guards.d.ts +22 -1
- package/types/signal/index.d.ts +6 -0
- package/types/signal/mcp/McpDocument.d.ts +65 -0
- package/types/signal/mcp/McpProgress.d.ts +40 -0
- package/types/signal/mcp/McpUriTemplate.d.ts +26 -0
- package/types/signal/mcp/Msg.d.ts +143 -0
- package/types/signal/mcp/index.d.ts +5 -0
- package/types/signal/mcp/mcpProtocol.d.ts +107 -0
- package/types/signal/mcp.d.ts +1 -0
- package/types/signal/openapi/openapi.d.ts +3 -3
- package/types/signal/schema/JsonSchemaBuilder.d.ts +47 -0
- package/types/signal/schema/index.d.ts +1 -0
- package/types/signal/schema.d.ts +1 -0
- package/types/signal/signalContext.d.ts +16 -1
- package/types/signal/slice.d.ts +8 -8
- package/types/signal/types.d.ts +1 -1
- package/types/store/actionTag.d.ts +21 -0
- package/types/store/agent/AgentBridge.d.ts +77 -0
- package/types/store/agent/AgentContext.d.ts +16 -0
- package/types/store/agent/AgentPrompts.d.ts +31 -0
- package/types/store/agent/AgentVisibility.d.ts +21 -0
- package/types/store/agent/ScreenReader.d.ts +11 -0
- package/types/store/agent/StoreCatalogue.d.ts +26 -0
- package/types/store/agent/StoreSurfaceSource.d.ts +18 -0
- package/types/store/agent/index.d.ts +9 -0
- package/types/store/agent/storeSurface.d.ts +14 -0
- package/types/store/agent/types.d.ts +49 -0
- package/types/store/agent.d.ts +1 -0
- package/types/store/agentic/StToolBuilder.d.ts +41 -0
- package/types/store/agentic/attachAgentic.d.ts +14 -0
- package/types/store/agentic/index.d.ts +5 -0
- package/types/store/agentic/readableValue.d.ts +3 -0
- package/types/store/agentic/useStExpose.d.ts +8 -0
- package/types/store/agentic/useStState.d.ts +12 -0
- package/types/store/agentic.d.ts +1 -0
- package/types/store/baseSt.d.ts +29 -22
- package/types/store/databaseStateNames.d.ts +25 -0
- package/types/store/formSetterNames.d.ts +16 -0
- package/types/store/index.d.ts +7 -0
- package/types/store/rootStore.d.ts +5 -1
- package/types/store/sliceRole.d.ts +25 -0
- package/types/store/store.d.ts +7 -2
- package/types/store/storeInstance.d.ts +33 -1
- package/types/store/storeRegistry.d.ts +5 -0
- package/types/store/types.d.ts +15 -0
- package/types/store/withSelector.d.ts +7 -8
- package/types/test/registerDom.d.ts +1 -0
- package/types/ui/Agent/Approval.d.ts +7 -0
- package/types/ui/Agent/Bubble.d.ts +13 -0
- package/types/ui/Agent/Chat.d.ts +24 -0
- package/types/ui/Agent/Context.d.ts +9 -0
- package/types/ui/Agent/Dock.d.ts +16 -0
- package/types/ui/Agent/Guide.d.ts +9 -0
- package/types/ui/Agent/Section.d.ts +10 -0
- package/types/ui/Agent/StateKey.d.ts +16 -0
- package/types/ui/Agent/Tool.d.ts +15 -0
- package/types/ui/Agent/Transcript.d.ts +13 -0
- package/types/ui/Agent/Zone.d.ts +23 -0
- package/types/ui/Agent/fetchRunner.d.ts +12 -0
- package/types/ui/Agent/index.d.ts +17 -0
- package/types/ui/Agent/index_.d.ts +1 -0
- package/types/ui/Agent/sessionHistory.d.ts +12 -0
- package/types/ui/Agent.d.ts +1 -0
- package/types/ui/Badge.d.ts +1 -1
- package/types/ui/Button.d.ts +1 -1
- package/types/ui/CsrImage.d.ts +1 -1
- package/types/ui/Dropdown.d.ts +2 -0
- package/types/ui/Image.d.ts +3 -3
- package/types/ui/Layout/BottomInset.d.ts +2 -1
- package/types/ui/Layout/index.d.ts +1 -1
- package/types/ui/Signal/style.d.ts +4 -1
- package/types/ui/UiOverride/context.d.ts +14 -2
- package/types/ui/agentAttrs.d.ts +14 -0
- package/types/ui/index.d.ts +4 -1
- package/types/ui/overlayLayer.d.ts +24 -0
- package/types/ui/recipe/badgeRecipe.d.ts +7 -3
- package/types/ui/recipe/buttonRecipe.d.ts +7 -3
- package/types/ui/recipe/inputRecipe.d.ts +5 -1
- package/types/vendor/use-agentic/AgentProvider.d.ts +18 -0
- package/types/vendor/use-agentic/AgentScope.d.ts +9 -0
- package/types/vendor/use-agentic/AgentSession.d.ts +50 -0
- package/types/vendor/use-agentic/Agentic.d.ts +21 -0
- package/types/vendor/use-agentic/AgenticSurface.d.ts +44 -0
- package/types/vendor/use-agentic/httpRunner.d.ts +15 -0
- package/types/vendor/use-agentic/index.d.ts +13 -0
- package/types/vendor/use-agentic/surfaceContext.d.ts +5 -0
- package/types/vendor/use-agentic/types.d.ts +133 -0
- package/types/vendor/use-agentic/useAgent.d.ts +4 -0
- package/types/vendor/use-agentic/useAgentGuide.d.ts +6 -0
- package/types/vendor/use-agentic/useAgentResource.d.ts +7 -0
- package/types/vendor/use-agentic/useAgentState.d.ts +13 -0
- package/types/vendor/use-agentic/useAgentTool.d.ts +16 -0
- package/types/vendor/use-agentic.d.ts +1 -0
- package/types/webkit/index.d.ts +3 -0
- package/types/webkit/lazy.d.ts +12 -0
- package/types/webkit/useCsrValues.d.ts +3 -3
- package/types/webkit/useEscapeKey.d.ts +5 -0
- package/types/webkit/useFrameRuntime.d.ts +6 -1
- package/types/webkit/useScreenScope.d.ts +18 -0
- package/ui/Agent/Approval.tsx +29 -0
- package/ui/Agent/Bubble.tsx +74 -0
- package/ui/Agent/Chat.tsx +225 -0
- package/ui/Agent/Context.tsx +38 -0
- package/ui/Agent/Dock.tsx +72 -0
- package/ui/Agent/Guide.tsx +16 -0
- package/ui/Agent/Section.tsx +24 -0
- package/ui/Agent/StateKey.tsx +44 -0
- package/ui/Agent/Tool.tsx +66 -0
- package/ui/Agent/Transcript.tsx +33 -0
- package/ui/Agent/Zone.tsx +48 -0
- package/ui/Agent/fetchRunner.ts +30 -0
- package/ui/Agent/index.ts +12 -0
- package/ui/Agent/index_.tsx +4 -0
- package/ui/Agent/sessionHistory.ts +33 -0
- package/ui/Badge.tsx +3 -3
- package/ui/BottomSheet.tsx +5 -0
- package/ui/Button.tsx +6 -2
- package/ui/Constant/Doc.tsx +1 -1
- package/ui/CsrImage.tsx +1 -1
- package/ui/Data/ListContainer.tsx +1 -1
- package/ui/DatePicker.tsx +5 -4
- package/ui/Dialog/Modal.tsx +12 -15
- package/ui/DraggableList.tsx +3 -1
- package/ui/Dropdown.tsx +33 -11
- package/ui/Field.tsx +30 -16
- package/ui/Image.tsx +3 -3
- package/ui/Input.tsx +14 -5
- package/ui/Layout/BottomInset.tsx +6 -1
- package/ui/Load/Units.tsx +11 -2
- package/ui/Load/View.tsx +7 -2
- package/ui/Loading/ProgressBar.tsx +8 -1
- package/ui/Menu.tsx +7 -8
- package/ui/Model/EditModal.tsx +37 -2
- package/ui/Model/SureToRemove.tsx +2 -1
- package/ui/Model/index_.tsx +42 -15
- package/ui/ObjectId.tsx +3 -4
- package/ui/Pagination.tsx +3 -4
- package/ui/Popconfirm.tsx +8 -7
- package/ui/Select.tsx +6 -4
- package/ui/Signal/RestApi.tsx +43 -16
- package/ui/Signal/WebSocket.tsx +1 -1
- package/ui/Signal/style.ts +6 -1
- package/ui/Switch.tsx +2 -0
- package/ui/System/CSR.tsx +6 -2
- package/ui/System/ThemeToggle.tsx +55 -33
- package/ui/ToggleSelect.tsx +4 -3
- package/ui/Tooltip.tsx +2 -1
- package/ui/UiOverride/context.ts +14 -2
- package/ui/agentAttrs.ts +19 -0
- package/ui/index.ts +10 -1
- package/ui/overlayLayer.ts +39 -0
- package/ui/recipe/badgeRecipe.ts +22 -3
- package/ui/recipe/buttonRecipe.ts +51 -2
- package/ui/recipe/factory.ts +2 -2
- package/ui/recipe/inputRecipe.ts +18 -4
- package/vendor/use-agentic/AgentProvider.tsx +39 -0
- package/vendor/use-agentic/AgentScope.tsx +20 -0
- package/vendor/use-agentic/AgentSession.ts +292 -0
- package/vendor/use-agentic/Agentic.tsx +44 -0
- package/vendor/use-agentic/AgenticSurface.ts +294 -0
- package/vendor/use-agentic/WIRE.md +57 -0
- package/vendor/use-agentic/httpRunner.ts +115 -0
- package/vendor/use-agentic/index.ts +14 -0
- package/vendor/use-agentic/surfaceContext.ts +9 -0
- package/vendor/use-agentic/types.ts +144 -0
- package/vendor/use-agentic/useAgent.ts +17 -0
- package/vendor/use-agentic/useAgentGuide.ts +16 -0
- package/vendor/use-agentic/useAgentResource.ts +30 -0
- package/vendor/use-agentic/useAgentState.ts +61 -0
- package/vendor/use-agentic/useAgentTool.ts +55 -0
- package/webkit/bootCsr.tsx +2 -33
- package/webkit/index.ts +3 -0
- package/webkit/lazy.tsx +27 -3
- package/webkit/useCsrValues.ts +121 -4
- package/webkit/useEscapeKey.tsx +42 -0
- package/webkit/useFrameRuntime.ts +65 -32
- package/webkit/useScreenScope.tsx +49 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AgentRunner } from "../../vendor/use-agentic.d.ts";
|
|
2
|
+
import { type PersistOption } from "./sessionHistory.d.ts";
|
|
3
|
+
export interface ChatProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
/** App-global framing. Route-scoped guidance layers on it through mounted `Agent.Guide`s. */
|
|
7
|
+
instructions?: string;
|
|
8
|
+
/** Swap the transport; the default drives the app's `runAgentTurn` endpoint. */
|
|
9
|
+
runner?: AgentRunner;
|
|
10
|
+
maxTurns?: number;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
/** Keeps the transcript across reloads — sessionStorage by default, `{ storage: "local" }` to outlive the tab. */
|
|
13
|
+
persist?: PersistOption;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The user-facing half of the in-page agent: one floating chat wired to the same surface the dock inspects.
|
|
17
|
+
* The conversation loop runs in this browser session — every tool call executes here, gated by the approval
|
|
18
|
+
* card — and the session lives in a ref, so it survives reopening the panel and dies with the page (v1 keeps
|
|
19
|
+
* no history). An enclosing AgentProvider's session wins, which is how an app isolates a surface or swaps the
|
|
20
|
+
* loop while keeping this UI.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DefaultChat: ({ className, title, instructions, runner, maxTurns, defaultOpen, persist, }: ChatProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare const _default: import("react").ComponentType<ChatProps>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ContextProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Assembles and shows the exact context blocks a turn would carry, on demand — the one preview of "what does the
|
|
6
|
+
* agent see on this screen" that no amount of reading the source answers.
|
|
7
|
+
*/
|
|
8
|
+
export default function Context({ className }: ContextProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AgentBridge } from "akanjs/store";
|
|
2
|
+
export interface DockProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** Pass the bridge an agent is already driving so both write into one transcript. Defaults to the app's own. */
|
|
5
|
+
bridge?: AgentBridge;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The in-page surface of the agent bridge: what this page lets an agent do, what it refused, and what it has done.
|
|
10
|
+
*
|
|
11
|
+
* It drives the store directly rather than talking to a model, because a model is not the framework's to choose —
|
|
12
|
+
* there is no provider or key here. An app wires its own agent to `bridge.tools` / `bridge.call` and can render this
|
|
13
|
+
* beside it; on its own it is the way to see the catalogue a page actually publishes, which is the one thing no
|
|
14
|
+
* amount of reading the source answers.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Dock: ({ className, bridge, open }: DockProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface GuideProps {
|
|
2
|
+
instructions: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Standing agent guidance scoped to a route subtree: render it from a `_layout.tsx` or a page and the text joins
|
|
6
|
+
* the turn's instructions while that subtree is mounted. Nesting layers naturally — each mounted Guide contributes
|
|
7
|
+
* its block, and navigating away withdraws it. Renders nothing.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Guide: ({ instructions }: GuideProps) => null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface SectionProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
title: string;
|
|
5
|
+
count: number;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function Section({ className, title, count, children, open }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentBridge, SerializedStoreState } from "akanjs/store";
|
|
2
|
+
interface StateKeyProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
bridge: AgentBridge;
|
|
5
|
+
name: string;
|
|
6
|
+
entry: SerializedStoreState;
|
|
7
|
+
live?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One readable state key, read on demand rather than rendered with the rest.
|
|
11
|
+
*
|
|
12
|
+
* Reading is where masking happens, so a key that holds an object no model claims refuses here instead of in the
|
|
13
|
+
* catalogue — whether it is readable depends on what is in it, which the catalogue cannot know ahead of time.
|
|
14
|
+
*/
|
|
15
|
+
export default function StateKey({ className, bridge, name, entry, live }: StateKeyProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AgentBridge, AgentTool } from "akanjs/store";
|
|
2
|
+
interface ToolProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
bridge: AgentBridge;
|
|
5
|
+
tool: AgentTool;
|
|
6
|
+
onRun: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One published action, with the arguments as JSON rather than as a generated form.
|
|
10
|
+
*
|
|
11
|
+
* A form per argument is what the API explorer does, and it is the wrong trade here: the point of the dock is to
|
|
12
|
+
* watch a call land in the running app, and every schema shape the store publishes is already legible as JSON.
|
|
13
|
+
*/
|
|
14
|
+
export default function Tool({ className, bridge, tool, onRun }: ToolProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentCall } from "akanjs/store";
|
|
2
|
+
interface TranscriptProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
calls: readonly AgentCall[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* What the agent did, newest last, so the user can check it against what they saw the page do.
|
|
8
|
+
*
|
|
9
|
+
* There is no undo here. Every model removal in this framework is soft, so one is possible in principle, but which
|
|
10
|
+
* writes are reversible is a per-module judgement and `local/agent-native/PLAN.md` §9-3 leaves it open.
|
|
11
|
+
*/
|
|
12
|
+
export default function Transcript({ className, calls }: TranscriptProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type AgentRunner } from "../../vendor/use-agentic.d.ts";
|
|
3
|
+
import { type PersistOption } from "./sessionHistory.d.ts";
|
|
4
|
+
export interface ZoneProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Names the zone; the scope id and the `data-agent-zone` container both derive from it. */
|
|
7
|
+
id: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Zone-scoped guidance — a mounted Guide, so the root agent reads it too (ancestor rule), a sibling zone never does. */
|
|
10
|
+
instructions?: string;
|
|
11
|
+
runner?: AgentRunner;
|
|
12
|
+
maxTurns?: number;
|
|
13
|
+
/** Keeps this zone's transcript across reloads, keyed by the zone's scope path. */
|
|
14
|
+
persist?: PersistOption;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A zone agent: one subtree with its own conversation over a scoped view of the same surface. Everything mounted
|
|
19
|
+
* inside — hook tools, `st.use` subscriptions, guides — belongs to this zone's session *and* to the root agent:
|
|
20
|
+
* zones are views, never walls. An `Agent.Chat` mounted inside binds to this session automatically, so two zones
|
|
21
|
+
* on one screen run two conversations in parallel, each seeing only its own subtree.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Zone: ({ className, id, label, instructions, runner, maxTurns, persist, children }: ZoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AgentRunner } from "../../vendor/use-agentic.d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Runs each assistant turn against the app's own `runAgentTurn` route — service signals mount unprefixed, so the
|
|
4
|
+
* URL is `<serverHttpUri>/runAgentTurn` — through the shared `httpRunner`, which negotiates streaming via
|
|
5
|
+
* `accept`: a server that streams answers SSE and the text arrives as it is generated; one that does not answers
|
|
6
|
+
* the same JSON turn. The client runtime's fetch proxy is only probed for whether the endpoint exists (the util
|
|
7
|
+
* lib ships one) and for the signed-in JWT; cookies ride the same-origin request on their own. The endpoint is a
|
|
8
|
+
* stateless relay; the loop and every tool execution stay in this browser session.
|
|
9
|
+
*/
|
|
10
|
+
export declare const fetchRunner: (options?: {
|
|
11
|
+
fetcher?: typeof globalThis.fetch;
|
|
12
|
+
}) => AgentRunner;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Context from "./Context.d.ts";
|
|
2
|
+
import Section from "./Section.d.ts";
|
|
3
|
+
import StateKey from "./StateKey.d.ts";
|
|
4
|
+
import Tool from "./Tool.d.ts";
|
|
5
|
+
import Transcript from "./Transcript.d.ts";
|
|
6
|
+
export declare const Agent: {
|
|
7
|
+
Chat: import("react").ComponentType<import("./Chat.d.ts").ChatProps>;
|
|
8
|
+
Context: typeof Context;
|
|
9
|
+
Dock: ({ className, bridge, open }: import("./Dock.d.ts").DockProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Guide: ({ instructions }: import("./Guide.d.ts").GuideProps) => null;
|
|
11
|
+
Scope: ({ id, label, kind, children }: import("../../vendor/use-agentic.d.ts").AgentScopeProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
Section: typeof Section;
|
|
13
|
+
StateKey: typeof StateKey;
|
|
14
|
+
Tool: typeof Tool;
|
|
15
|
+
Transcript: typeof Transcript;
|
|
16
|
+
Zone: ({ className, id, label, instructions, runner, maxTurns, persist, children }: import("./Zone.d.ts").ZoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Chat: import("react").ComponentType<import("./Chat.d.ts").ChatProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SessionHistory } from "../../vendor/use-agentic.d.ts";
|
|
2
|
+
export type PersistOption = boolean | {
|
|
3
|
+
storage?: "session" | "local";
|
|
4
|
+
key?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Maps the `persist` prop onto a `SessionHistory` over web storage. Session storage is the default on purpose:
|
|
8
|
+
* surviving a refresh is the whole ask, and a transcript that dies with the tab never lingers on a shared machine
|
|
9
|
+
* or collides across tabs. `"local"` is the explicit opt-up. The envelope is versioned so a wire change discards
|
|
10
|
+
* stale transcripts instead of replaying them, and only the newest messages are kept under the cap.
|
|
11
|
+
*/
|
|
12
|
+
export declare const sessionHistoryOf: (persist: PersistOption | undefined, pathKey?: string) => SessionHistory | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Agent/index.d.ts";
|
package/types/ui/Badge.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "react";
|
|
2
2
|
import { type BadgeVariants, badgeRecipe } from "./recipe.d.ts";
|
|
3
|
-
export {
|
|
3
|
+
export { type BadgeVariants, badgeRecipe };
|
|
4
4
|
export type BadgeProps = HTMLAttributes<HTMLSpanElement> & BadgeVariants;
|
|
5
5
|
/** Status/label pill. Route-overridable via `page/**\/_overrides.tsx` (slot `Badge`). */
|
|
6
6
|
export declare const Badge: import("react").ComponentType<BadgeProps>;
|
package/types/ui/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import { type ButtonHTMLAttributes } from "react";
|
|
3
3
|
import { type ButtonVariants, buttonRecipe } from "./recipe.d.ts";
|
|
4
|
-
export {
|
|
4
|
+
export { type ButtonVariants, buttonRecipe };
|
|
5
5
|
export type ButtonProps<Result> = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & ButtonVariants & {
|
|
6
6
|
/**
|
|
7
7
|
* Click handler. Returning a promise is what opts this button into the async states — a plain
|
package/types/ui/CsrImage.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type CsrImageProps = Omit<ImgHTMLAttributes<HTMLImageElement>, "alt" | "src"> &
|
|
|
7
7
|
imageSize: [number, number];
|
|
8
8
|
abstractData?: string | null;
|
|
9
9
|
} | null;
|
|
10
|
-
abstractData?: string;
|
|
10
|
+
abstractData?: string | null;
|
|
11
11
|
priority?: boolean;
|
|
12
12
|
preload?: boolean;
|
|
13
13
|
quality?: number;
|
package/types/ui/Dropdown.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
+
/** Put this on a menu item that runs its own interaction (a switch, a copy button) to keep the menu open. */
|
|
3
|
+
export declare const DROPDOWN_KEEP_OPEN_ATTR = "data-dropdown-keep-open";
|
|
2
4
|
export interface DropdownProps {
|
|
3
5
|
/** Button/trigger content. */
|
|
4
6
|
value: ReactNode;
|
package/types/ui/Image.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ type AkanImageProps = NativeImageProps & {
|
|
|
19
19
|
/** Akan file object or file-like value with url and imageSize metadata. */
|
|
20
20
|
file?: ImageLikeFile;
|
|
21
21
|
/** Low-quality preview data. Overrides file.abstractData when provided. */
|
|
22
|
-
abstractData?: string;
|
|
22
|
+
abstractData?: string | null;
|
|
23
23
|
/** Accessible alt text. Defaults to "image" when omitted. */
|
|
24
24
|
alt?: string;
|
|
25
25
|
/** Image optimizer quality. Defaults to 75. */
|
|
@@ -34,11 +34,11 @@ type AkanImageProps = NativeImageProps & {
|
|
|
34
34
|
export declare const Image: ({ src, file, className, abstractData, alt, quality, priority, preload, unoptimized, ...props }: AkanImageProps & ({
|
|
35
35
|
src?: string;
|
|
36
36
|
file?: ProtoFile;
|
|
37
|
-
abstractData?: string;
|
|
37
|
+
abstractData?: string | null;
|
|
38
38
|
alt?: string;
|
|
39
39
|
} | {
|
|
40
40
|
src?: undefined;
|
|
41
|
-
abstractData?: string;
|
|
41
|
+
abstractData?: string | null;
|
|
42
42
|
file: {
|
|
43
43
|
url: string;
|
|
44
44
|
imageSize: [number, number];
|
|
@@ -4,10 +4,11 @@ export interface BottomInsetProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
keyboardSticky?: boolean;
|
|
7
|
+
contentAnchor?: "bottom";
|
|
7
8
|
role?: "bottomChrome" | "keyboardAccessory";
|
|
8
9
|
estimatedHeight?: number;
|
|
9
10
|
frameScope?: FrameSlotRegistration["scope"];
|
|
10
11
|
frameSource?: FrameSlotRegistration["source"];
|
|
11
12
|
frameCache?: boolean;
|
|
12
13
|
}
|
|
13
|
-
export declare const BottomInset: ({ className, children, keyboardSticky, role, estimatedHeight, frameScope, frameSource, frameCache, }: BottomInsetProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const BottomInset: ({ className, children, keyboardSticky, contentAnchor, role, estimatedHeight, frameScope, frameSource, frameCache, }: BottomInsetProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ export declare const Layout: {
|
|
|
4
4
|
Navbar: ({ back, className, height, children, title, left, right }: import("./Navbar.d.ts").NavbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
TopInset: ({ className, children, estimatedHeight }: import("./TopInset.d.ts").TopInsetProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
BottomTab: ({ className, tabs, height }: import("./BottomTab.d.ts").BottomTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
BottomInset: ({ className, children, keyboardSticky, role, estimatedHeight, frameScope, frameSource, frameCache, }: import("./BottomInset.d.ts").BottomInsetProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
BottomInset: ({ className, children, keyboardSticky, contentAnchor, role, estimatedHeight, frameScope, frameSource, frameCache, }: import("./BottomInset.d.ts").BottomInsetProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
Template: ({ className, children }: import("./Template.d.ts").TemplateProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
Unit: ({ className, children, href }: import("./Unit.d.ts").UnitProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
View: ({ className, children }: import("./View.d.ts").ViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,10 @@ export declare const signalUi: {
|
|
|
8
8
|
inputLabel: string;
|
|
9
9
|
codePanel: string;
|
|
10
10
|
};
|
|
11
|
+
/** Writes carry the accent, reads do not — so the two write types are named and everything else reads. */
|
|
11
12
|
export declare const getEndpointBadgeClassName: (type: string) => string;
|
|
12
13
|
export declare const getGuardBadgeClassName: (guard: string) => string;
|
|
14
|
+
/** Published to agents carries the accent; opted in and refused is outlined, because it is a thing to go fix. */
|
|
15
|
+
export declare const getMcpBadgeClassName: (exposed: boolean) => string;
|
|
13
16
|
export declare const getStatusBadgeClassName: (status: string) => string;
|
|
14
|
-
export declare const getStatusTextareaClassName: (status: string) => "" | "pointer-events-none opacity-50" | "border-destructive text-destructive"
|
|
17
|
+
export declare const getStatusTextareaClassName: (status: string) => "" | "border-primary" | "pointer-events-none opacity-50" | "border-destructive text-destructive";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ComponentType } from "react";
|
|
2
2
|
import type { ClassNameValue as ClassValue } from "tailwind-merge";
|
|
3
|
+
import type { ChatProps as AgentChatProps } from "../Agent/Chat.d.ts";
|
|
3
4
|
import type { BadgeProps } from "../Badge.d.ts";
|
|
4
5
|
import type { ButtonProps } from "../Button.d.ts";
|
|
5
6
|
import type { DatePickerProps, RangePickerProps, TimePickerProps } from "../DatePicker.d.ts";
|
|
@@ -16,7 +17,7 @@ import type { ModalProps } from "../Modal.d.ts";
|
|
|
16
17
|
import type { PaginationProps } from "../Pagination.d.ts";
|
|
17
18
|
import type { PopconfirmProps } from "../Popconfirm.d.ts";
|
|
18
19
|
import type { ItemProps as RadioItemProps, RadioProps } from "../Radio.d.ts";
|
|
19
|
-
import type { BadgeVariants, ButtonVariants } from "../recipe.d.ts";
|
|
20
|
+
import type { BadgeVariants, ButtonVariants, InputSurfaceVariants } from "../recipe.d.ts";
|
|
20
21
|
import type { SelectProps } from "../Select.d.ts";
|
|
21
22
|
import type { TableProps } from "../Table.d.ts";
|
|
22
23
|
import type { MultiProps as ToggleSelectMultiProps, ToggleSelectProps } from "../ToggleSelect.d.ts";
|
|
@@ -45,6 +46,7 @@ export interface AkanUiOverrides {
|
|
|
45
46
|
Menu: ComponentType<MenuProps>;
|
|
46
47
|
Tooltip: ComponentType<TooltipProps>;
|
|
47
48
|
Unauthorized: ComponentType<UnauthorizedProps>;
|
|
49
|
+
AgentChat: ComponentType<AgentChatProps>;
|
|
48
50
|
Button: ComponentType<ButtonProps<unknown>>;
|
|
49
51
|
Select: ComponentType<SelectProps<string | number | boolean | null | undefined>>;
|
|
50
52
|
Input: ComponentType<InputProps>;
|
|
@@ -75,11 +77,21 @@ export type AkanModalComponent = AkanUiOverrides["Modal"];
|
|
|
75
77
|
* manifest: `override({ recipes: { button: neonButtonRecipe } })`. A recipe swap changes
|
|
76
78
|
* only the className factory — the component's structure/behavior (async states, focus,
|
|
77
79
|
* a11y) is untouched. Each replacement must accept the framework recipe's full variant
|
|
78
|
-
* contract, so every call site keeps working
|
|
80
|
+
* contract, so every call site keeps working (a replacement with *extra* optional axes is
|
|
81
|
+
* assignable — contravariance — but those axes are only reachable from code that knows the
|
|
82
|
+
* replacement's own type).
|
|
83
|
+
*
|
|
84
|
+
* Scope: a recipe slot is a **client-side, route-scoped restyle**. It reaches framework
|
|
85
|
+
* client components, which resolve through `useUiRecipe(...)`. It never reaches a raw
|
|
86
|
+
* `xRecipe(...)` call in app JSX (statically imported — no context), nor server components
|
|
87
|
+
* (`Unit`/`View`), which intentionally render the canonical framework recipe. Extending the
|
|
88
|
+
* *vocabulary* is not this slot's job: add the axis to the framework recipe, or author an
|
|
89
|
+
* app recipe in `apps/<app>/ui/Recipe/`.
|
|
79
90
|
*/
|
|
80
91
|
export interface AkanUiRecipes {
|
|
81
92
|
button: (variants?: ButtonVariants, className?: ClassValue) => string;
|
|
82
93
|
badge: (variants?: BadgeVariants, className?: ClassValue) => string;
|
|
94
|
+
input: (variants?: InputSurfaceVariants, className?: ClassValue) => string;
|
|
83
95
|
}
|
|
84
96
|
/** Shape of an `_overrides.tsx` manifest: component slots plus an optional recipe-slot map. */
|
|
85
97
|
export type AkanUiOverrideManifest = Partial<AkanUiOverrides> & {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `data-akan-*` attributes for a handler the caller passed by reference.
|
|
3
|
+
*
|
|
4
|
+
* `{}` when the handler is an inline arrow, which is the honest answer: a closure the caller wrote says nothing
|
|
5
|
+
* about what it does, and a guessed annotation is worse than none. The house form for a model field is the setter
|
|
6
|
+
* itself (`onChange={st.do.setNameOnUser}`), so the fields that matter are annotated without an app writing anything.
|
|
7
|
+
*
|
|
8
|
+
* What it buys, beyond an in-page agent: an accessibility tree and E2E selectors that name the action rather than a
|
|
9
|
+
* class, and an external browser agent — one this framework has no bridge into — reading the same names.
|
|
10
|
+
*/
|
|
11
|
+
export declare const agentAttrs: (handler: unknown) => {
|
|
12
|
+
"data-akan-action"?: string;
|
|
13
|
+
"data-akan-state"?: string;
|
|
14
|
+
} | Record<string, never>;
|
package/types/ui/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { Agent } from "./Agent.d.ts";
|
|
2
|
+
export { agentAttrs } from "./agentAttrs.d.ts";
|
|
1
3
|
export { animated } from "./animated.d.ts";
|
|
2
4
|
export { Badge } from "./Badge.d.ts";
|
|
3
5
|
export { BottomSheet, type BottomSheetRef } from "./BottomSheet.d.ts";
|
|
@@ -12,7 +14,7 @@ export { DatePicker } from "./DatePicker.d.ts";
|
|
|
12
14
|
export { Dialog } from "./Dialog.d.ts";
|
|
13
15
|
export { DragAction } from "./DragAction.d.ts";
|
|
14
16
|
export { DraggableList } from "./DraggableList.d.ts";
|
|
15
|
-
export { Dropdown } from "./Dropdown.d.ts";
|
|
17
|
+
export { DROPDOWN_KEEP_OPEN_ATTR, Dropdown } from "./Dropdown.d.ts";
|
|
16
18
|
export { Empty } from "./Empty.d.ts";
|
|
17
19
|
export { Field } from "./Field.d.ts";
|
|
18
20
|
export { FontFace } from "./FontFace.d.ts";
|
|
@@ -29,6 +31,7 @@ export { Modal } from "./Modal.d.ts";
|
|
|
29
31
|
export { Model } from "./Model.d.ts";
|
|
30
32
|
export { More } from "./More.d.ts";
|
|
31
33
|
export { ObjectId } from "./ObjectId.d.ts";
|
|
34
|
+
export { isOwnOverlayClick, OVERLAY_LAYER_ATTR, OverlayOwnerProvider, useOverlayLayerProps, useOverlayScope, } from "./overlayLayer.d.ts";
|
|
32
35
|
export { Pagination } from "./Pagination.d.ts";
|
|
33
36
|
export { Popconfirm } from "./Popconfirm.d.ts";
|
|
34
37
|
export { Portal } from "./Portal.d.ts";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlay surfaces render through `createPortal(document.body)`, so they leave the DOM subtree of the
|
|
3
|
+
* component that opened them, and a dismiss check asking `ref.current.contains(target)` reads every
|
|
4
|
+
* click inside a dialog it opened *itself* as an outside click.
|
|
5
|
+
*
|
|
6
|
+
* React context reaches through a portal where the DOM does not, so an overlay can read which
|
|
7
|
+
* dismissable scope rendered it and stamp that owner on the roots it portals out. A scope then
|
|
8
|
+
* recognises its own overlays exactly, instead of guessing from how close a dialog happens to be.
|
|
9
|
+
*/
|
|
10
|
+
export declare const OVERLAY_LAYER_ATTR = "data-akan-overlay";
|
|
11
|
+
/** Wrap the content a dismissable container owns, with the scope from {@link useOverlayScope}. */
|
|
12
|
+
export declare const OverlayOwnerProvider: import("react").Provider<string>;
|
|
13
|
+
/** Scope a dismissable container hands to its content. Nests as a `parent/child` path. */
|
|
14
|
+
export declare const useOverlayScope: (id: string) => string;
|
|
15
|
+
/** Props an overlay spreads onto every root it portals out of its own tree. */
|
|
16
|
+
export declare const useOverlayLayerProps: () => {
|
|
17
|
+
"data-akan-overlay": string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* True when the click landed in an overlay that `scope` — or a scope nested inside it — rendered.
|
|
21
|
+
* An overlay nobody owns, and one owned by an unrelated scope, both read as an ordinary outside
|
|
22
|
+
* click, so a menu does not linger behind a dialog it has nothing to do with.
|
|
23
|
+
*/
|
|
24
|
+
export declare const isOwnOverlayClick: (target: EventTarget | null, scope: string) => boolean;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
/** 뱃지 look — 시맨틱 variant
|
|
1
|
+
/** 뱃지 look — 시맨틱 variant × size, outline 플래그는 색을 유지한 외곽선 스타일. `<Badge>` 가 소비하며, recipes.badge 슬롯으로 교체 가능. */
|
|
2
2
|
export declare const badgeRecipe: (variants?: Omit<({
|
|
3
|
-
|
|
3
|
+
size?: "lg" | "md" | "sm" | "xs" | undefined;
|
|
4
|
+
outline?: boolean | undefined;
|
|
5
|
+
variant?: "default" | "error" | "info" | "success" | "warning" | "primary" | "secondary" | "accent" | "neutral" | "outline" | undefined;
|
|
4
6
|
} & {
|
|
5
7
|
class?: import("tailwind-variants").ClassValue;
|
|
6
8
|
className?: never;
|
|
7
9
|
}) | ({
|
|
8
|
-
|
|
10
|
+
size?: "lg" | "md" | "sm" | "xs" | undefined;
|
|
11
|
+
outline?: boolean | undefined;
|
|
12
|
+
variant?: "default" | "error" | "info" | "success" | "warning" | "primary" | "secondary" | "accent" | "neutral" | "outline" | undefined;
|
|
9
13
|
} & {
|
|
10
14
|
class?: never;
|
|
11
15
|
className?: import("tailwind-variants").ClassValue;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
/** 버튼 look — 시맨틱 variant × size
|
|
1
|
+
/** 버튼 look — 시맨틱 variant × size × shape, outline 플래그는 색을 유지한 외곽선 스타일. `<Button>` 이 소비하며, `_overrides.tsx` 의 recipes.button 슬롯으로 교체 가능. */
|
|
2
2
|
export declare const buttonRecipe: (variants?: Omit<({
|
|
3
3
|
size?: "lg" | "md" | "sm" | "xs" | "icon" | undefined;
|
|
4
|
-
|
|
4
|
+
outline?: boolean | undefined;
|
|
5
|
+
variant?: "link" | "default" | "info" | "success" | "warning" | "primary" | "secondary" | "accent" | "destructive" | "neutral" | "outline" | "ghost" | undefined;
|
|
6
|
+
shape?: "default" | "circle" | "square" | undefined;
|
|
5
7
|
} & {
|
|
6
8
|
class?: import("tailwind-variants").ClassValue;
|
|
7
9
|
className?: never;
|
|
8
10
|
}) | ({
|
|
9
11
|
size?: "lg" | "md" | "sm" | "xs" | "icon" | undefined;
|
|
10
|
-
|
|
12
|
+
outline?: boolean | undefined;
|
|
13
|
+
variant?: "link" | "default" | "info" | "success" | "warning" | "primary" | "secondary" | "accent" | "destructive" | "neutral" | "outline" | "ghost" | undefined;
|
|
14
|
+
shape?: "default" | "circle" | "square" | undefined;
|
|
11
15
|
} & {
|
|
12
16
|
class?: never;
|
|
13
17
|
className?: import("tailwind-variants").ClassValue;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
/** 입력 표면 look — Input/TextArea 가 공유하는 필드 셸. kind 로 한 줄 필드(field)/멀티라인(area)
|
|
1
|
+
/** 입력 표면 look — Input/TextArea/Select 가 공유하는 필드 셸. kind 로 한 줄 필드(field)/멀티라인(area), tone 으로 강조/오류 상태를 고른다. */
|
|
2
2
|
export declare const inputRecipe: (variants?: Omit<({
|
|
3
|
+
size?: "xl" | "lg" | "md" | "sm" | "xs" | undefined;
|
|
3
4
|
kind?: "field" | "area" | undefined;
|
|
5
|
+
tone?: "default" | "error" | "primary" | undefined;
|
|
4
6
|
} & {
|
|
5
7
|
class?: import("tailwind-variants").ClassValue;
|
|
6
8
|
className?: never;
|
|
7
9
|
}) | ({
|
|
10
|
+
size?: "xl" | "lg" | "md" | "sm" | "xs" | undefined;
|
|
8
11
|
kind?: "field" | "area" | undefined;
|
|
12
|
+
tone?: "default" | "error" | "primary" | undefined;
|
|
9
13
|
} & {
|
|
10
14
|
class?: never;
|
|
11
15
|
className?: import("tailwind-variants").ClassValue;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { AgenticSurface } from "./AgenticSurface.d.ts";
|
|
3
|
+
import { AgentSession, type AgentSessionOptions } from "./AgentSession.d.ts";
|
|
4
|
+
import type { AgentRunner } from "./types.d.ts";
|
|
5
|
+
interface AgentProviderProps extends AgentSessionOptions {
|
|
6
|
+
surface?: AgenticSurface;
|
|
7
|
+
session?: AgentSession;
|
|
8
|
+
runner?: AgentRunner;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Scopes a subtree onto one surface and, when a runner or session is given, one conversation.
|
|
13
|
+
*
|
|
14
|
+
* Without a provider, hooks land on `AgenticSurface.shared` — a provider exists to isolate, or to hold the session
|
|
15
|
+
* `useAgent` reads.
|
|
16
|
+
*/
|
|
17
|
+
export declare const AgentProvider: ({ surface, session, runner, children, ...options }: AgentProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface AgentScopeProps {
|
|
3
|
+
id: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
kind?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Namespaces every tool and resource registered below it, so list items can reuse local names. */
|
|
9
|
+
export declare const AgentScope: ({ id, label, kind, children }: AgentScopeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { AgentRunner, ChatMessage, ContextBlock, SurfaceView } from "./types.d.ts";
|
|
2
|
+
export interface PendingApproval {
|
|
3
|
+
callId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
args: Record<string, unknown>;
|
|
6
|
+
message: string;
|
|
7
|
+
approve: () => void;
|
|
8
|
+
reject: (reason?: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Where a session keeps its transcript across page loads. Storage-neutral: the host decides what backs it. */
|
|
11
|
+
export interface SessionHistory {
|
|
12
|
+
load(): ChatMessage[] | null;
|
|
13
|
+
save(messages: readonly ChatMessage[]): void;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
export interface AgentSessionOptions {
|
|
17
|
+
instructions?: string;
|
|
18
|
+
buildContext?: (surface: SurfaceView) => ContextBlock[];
|
|
19
|
+
/** Assistant turns per send before the session stops the loop. */
|
|
20
|
+
maxTurns?: number;
|
|
21
|
+
/** Restores settled messages at construction and saves after every change, debounced. Failures are silent. */
|
|
22
|
+
history?: SessionHistory;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The client-side conversation loop: send → model turn → tool calls → approval gate → execute → report diffs → next
|
|
26
|
+
* turn. The loop lives here rather than on a server because the tools do — the runner is one stateless model turn,
|
|
27
|
+
* so any backend that answers it works and none has to hold a session.
|
|
28
|
+
*
|
|
29
|
+
* Failures land in the transcript instead of being thrown past it: a refused guard, a rejected approval, and an
|
|
30
|
+
* unknown tool are all things the agent did, and the model reads them as tool results the same way a person reads
|
|
31
|
+
* them in the chat.
|
|
32
|
+
*/
|
|
33
|
+
export declare class AgentSession {
|
|
34
|
+
#private;
|
|
35
|
+
constructor(surface: SurfaceView, runner: AgentRunner, options?: AgentSessionOptions);
|
|
36
|
+
get surface(): SurfaceView;
|
|
37
|
+
get messages(): readonly ChatMessage[];
|
|
38
|
+
get isRunning(): boolean;
|
|
39
|
+
get pendingApproval(): PendingApproval | null;
|
|
40
|
+
/** Bumped on every change, so a store binding can use it as the snapshot. */
|
|
41
|
+
get version(): number;
|
|
42
|
+
subscribe: (listener: () => void) => () => void;
|
|
43
|
+
/** A user's text, or prewritten messages — how a host injects a prompt's result as the user's turn. */
|
|
44
|
+
send: (input: string | ChatMessage[]) => Promise<void>;
|
|
45
|
+
abort: () => void;
|
|
46
|
+
/** Empties the transcript and the persisted history. A running turn keeps its transcript. */
|
|
47
|
+
reset: () => void;
|
|
48
|
+
/** Records a host-side failure (a prompt fetch, an upload) in the transcript, where every other failure lands. */
|
|
49
|
+
report: (error: string) => void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import type { ToolConfirm, ToolEffect } from "./types.d.ts";
|
|
3
|
+
interface AgenticProps {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
effect?: ToolEffect;
|
|
7
|
+
confirm?: ToolConfirm;
|
|
8
|
+
children: ReactElement<{
|
|
9
|
+
onClick?: () => unknown;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Registers the child's `onClick` as a no-argument tool and renders the child untouched.
|
|
14
|
+
*
|
|
15
|
+
* The first-class path is passing a hook-made tool by reference as the handler itself; this wrapper is for
|
|
16
|
+
* elements whose handler you do not own — third-party components and embeds.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Agentic: ({ name, description, effect, confirm, children }: AgenticProps) => ReactElement<{
|
|
19
|
+
onClick?: () => unknown;
|
|
20
|
+
}, string | import("react").JSXElementConstructor<any>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ResourceDiff, ResourceEntry, ScopeEntry, SurfaceSnapshot, SurfaceSource, SurfaceView, ToolEntry } from "./types.d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The live registry of what the mounted screen offers an agent: tools, readable resources, and scopes.
|
|
4
|
+
*
|
|
5
|
+
* Entries come and go with component lifetimes, so unlike a static catalogue this is subscribable and every
|
|
6
|
+
* snapshot answers "now". A registration stack backs each name — remounts are ordinary React behavior, so a
|
|
7
|
+
* duplicate name warns and the newest wins instead of throwing, and unregistering restores what it shadowed.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AgenticSurface {
|
|
10
|
+
#private;
|
|
11
|
+
/** One surface per runtime unless a provider isolates its own. Keyed on `globalThis` so duplicated module copies still meet. */
|
|
12
|
+
static get shared(): AgenticSurface;
|
|
13
|
+
/** MCP tool names allow `[A-Za-z0-9_.-]`, and `.` is the scope join — so every part is folded into `[A-Za-z0-9_-]`. */
|
|
14
|
+
static sanitize(part: string): string;
|
|
15
|
+
static childPath(parent: string[], id: string): string[];
|
|
16
|
+
static fullName(scope: string[], name: string): string;
|
|
17
|
+
subscribe(listener: () => void): () => void;
|
|
18
|
+
registerTool(scope: string[], entry: ToolEntry): () => void;
|
|
19
|
+
registerResource(scope: string[], entry: ResourceEntry): () => void;
|
|
20
|
+
openScope(parent: string[], scope: ScopeEntry): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Standing guidance for the agent while the registrant is mounted — instructions, not context data. Kept in
|
|
23
|
+
* registration order rather than sorted: guides are prose, and each one must stay a coherent block.
|
|
24
|
+
*/
|
|
25
|
+
registerGuide(scope: string[], text: string): () => void;
|
|
26
|
+
addSource(source: SurfaceSource): () => void;
|
|
27
|
+
snapshot(view?: string[]): SurfaceSnapshot;
|
|
28
|
+
/**
|
|
29
|
+
* A zone session's reading half: the same registry filtered to one scope subtree. Hook entries filter by their
|
|
30
|
+
* scope-prefixed name, sources decide for themselves per view, and guides follow the layout cascade — a zone
|
|
31
|
+
* reads its ancestors' guidance plus its own, never a sibling's. The empty path is the surface itself.
|
|
32
|
+
*/
|
|
33
|
+
view(path: string[]): SurfaceView;
|
|
34
|
+
tool(name: string, view?: string[]): ToolEntry | null;
|
|
35
|
+
call(name: string, args?: Record<string, unknown>, view?: string[]): Promise<unknown>;
|
|
36
|
+
read(name: string, view?: string[]): unknown;
|
|
37
|
+
/**
|
|
38
|
+
* The resources that changed since `before`, for reporting a tool call's effect back to the model.
|
|
39
|
+
*
|
|
40
|
+
* Runs against the live entries rather than a second snapshot because `report: false` lives on the entry, and a
|
|
41
|
+
* snapshot deliberately does not publish it.
|
|
42
|
+
*/
|
|
43
|
+
diffSince(before: SurfaceSnapshot, view?: string[]): ResourceDiff[];
|
|
44
|
+
}
|