akanjs 3.1.0-rc.2 → 3.1.0-rc.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/base/baseEnv.ts +5 -2
- package/client/device.ts +1 -1
- package/client/frameConfig.ts +2 -2
- package/client/href.ts +35 -0
- package/client/index.ts +1 -0
- package/client/makePageProto.tsx +3 -2
- package/client/router.ts +6 -4
- package/client/rscNavigation.ts +1 -1
- package/client/transitionTypes.ts +0 -4
- package/client/translator.ts +16 -0
- package/client/types.ts +3 -2
- package/client/viewportMeta.ts +23 -8
- package/client/webManifest.ts +5 -3
- package/common/TrustedProxy.ts +14 -0
- package/common/codeAgentWire.ts +8 -1
- package/common/index.ts +1 -0
- package/common/interpolateTranslation.ts +17 -3
- package/common/isEmail.ts +1 -1
- package/common/localeConfig.ts +10 -4
- package/common/markdownSpans.ts +1 -1
- package/common/restClient.ts +3 -1
- package/common/routeConvention.ts +4 -4
- package/common/trimSlashes.ts +11 -0
- package/common/types.ts +1 -1
- package/constant/fieldInfo.ts +2 -2
- package/constant/fieldPlan.ts +80 -0
- package/constant/index.ts +3 -0
- package/constant/inputParser.ts +148 -0
- package/constant/invalidInputError.ts +13 -0
- package/constant/serialize.ts +36 -20
- package/constant/types.ts +1 -1
- package/constant/via.ts +2 -0
- package/dictionary/base.dictionary.ts +4 -0
- package/dictionary/trans.ts +8 -0
- package/document/database.ts +3 -6
- package/document/documentSchema.ts +1 -1
- package/document/noDocumentError.ts +6 -1
- package/fetch/client/fetchClient.ts +2 -1
- package/fetch/client/sliceInitHandle.ts +2 -3
- package/fetch/fetchType/appliedReturn.type.ts +3 -1
- package/fetch/types.ts +4 -2
- package/index.ts +2 -0
- package/package.json +31 -21
- package/server/akanApp.ts +15 -3
- package/server/akanServer.ts +34 -14
- package/server/artifact/routeClientCache.ts +4 -5
- package/server/artifact/routeSeedIndexStore.ts +3 -20
- package/server/artifact/routeSeedMatcher.ts +70 -0
- package/server/console.ts +1 -1
- package/server/di/diLifecycle.ts +16 -7
- package/server/imageOptimizer.ts +1 -1
- package/server/index.ts +1 -0
- package/server/machine/machineAccount.ts +28 -3
- package/server/machine/machineToken.ts +27 -3
- package/server/mcp/McpDispatcher.ts +2 -3
- package/server/mcp/McpExecutionContext.ts +9 -3
- package/server/migration/docPath.ts +121 -0
- package/server/migration/index.ts +15 -0
- package/server/migration/migrationChangeLog.ts +86 -0
- package/server/migration/migrationChanges.ts +70 -0
- package/server/migration/migrationCommand.ts +179 -0
- package/server/migration/migrationContext.ts +53 -0
- package/server/migration/migrationDefinition.ts +87 -0
- package/server/migration/migrationError.ts +45 -0
- package/server/migration/migrationLedger.ts +172 -0
- package/server/migration/migrationLock.ts +103 -0
- package/server/migration/migrationParams.ts +122 -0
- package/server/migration/migrationPulse.ts +39 -0
- package/server/migration/migrationRunner.ts +525 -0
- package/server/migration/migrationScope.ts +93 -0
- package/server/migration/migrationTable.ts +258 -0
- package/server/migration/migrations.ts +57 -0
- package/server/ops/opsCommand.ts +30 -1
- package/server/resolver/CascadeRunner.ts +15 -2
- package/server/resolver/signal.resolver.ts +35 -55
- package/server/routeState.ts +0 -6
- package/server/rscClient.tsx +22 -37
- package/server/rscNavigationState.ts +3 -5
- package/server/rscScrollRestoration.ts +116 -0
- package/server/rscWorker.tsx +12 -19
- package/server/sitemap.ts +4 -4
- package/server/tunnel/TunnelAgent.ts +9 -1
- package/server/webRouter.ts +17 -2
- package/service/agent.service.ts +21 -1
- package/service/endpointCacheKeys.ts +35 -0
- package/service/index.ts +1 -0
- package/service/injectInfo.ts +2 -2
- package/service/predefinedAdaptor/anthropicLlm.ts +37 -17
- package/service/predefinedAdaptor/database.adaptor.ts +15 -0
- package/service/predefinedAdaptor/documentTransfer.ts +50 -0
- package/service/predefinedAdaptor/endpointCacheControl.adaptor.ts +19 -0
- package/service/predefinedAdaptor/index.ts +1 -0
- package/service/predefinedAdaptor/llm.adaptor.ts +7 -0
- package/service/predefinedAdaptor/openaiDialect.ts +53 -17
- package/service/predefinedAdaptor/openaiLlm.ts +1 -1
- package/service/predefinedAdaptor/sql/MigrationTables.ts +90 -0
- package/service/predefinedAdaptor/sql/RawDocumentTable.ts +200 -0
- package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +6 -2
- package/service/predefinedAdaptor/sql/SqliteInsightSession.ts +4 -1
- package/service/predefinedAdaptor/sql/dialect/postgres.ts +0 -1
- package/service/predefinedAdaptor/sql/dialect/sqlite.ts +0 -1
- package/service/predefinedAdaptor/sql/types.ts +3 -1
- package/service/predefinedAdaptor/storage.adaptor.ts +19 -0
- package/signal/endpointCache.ts +23 -7
- package/signal/endpointErrorContract.ts +37 -0
- package/signal/endpointIdempotency.ts +5 -3
- package/signal/endpointInfo.ts +4 -1
- package/signal/endpointRateLimit.ts +6 -2
- package/signal/exception.ts +4 -1
- package/signal/index.ts +1 -0
- package/signal/mcp/McpDocument.ts +16 -1
- package/signal/mcp/McpUriTemplate.ts +1 -1
- package/signal/middlewareChain.ts +105 -0
- package/signal/openapi/openapi.ts +46 -2
- package/signal/serializer/fetch.serializer.ts +1 -0
- package/signal/signalContext.ts +110 -82
- package/signal/slice.ts +2 -2
- package/signal/trace.ts +8 -2
- package/signal/types.ts +13 -0
- package/store/action.ts +102 -42
- package/store/agent/ScreenImage.ts +166 -0
- package/store/agent/ScreenReader.ts +2 -1
- package/store/agent/StoreSurfaceSource.ts +41 -2
- package/store/agent/index.ts +2 -1
- package/store/databaseStateNames.ts +1 -0
- package/store/formUploadOf.ts +41 -0
- package/store/index.ts +1 -0
- package/store/liveInsert.ts +2 -2
- package/store/state.ts +9 -1
- package/store/stateBuilder.ts +8 -2
- package/store/storeInstance.ts +12 -3
- package/store/withSelector.ts +2 -2
- package/types/client/href.d.ts +11 -0
- package/types/client/index.d.ts +1 -0
- package/types/client/rscNavigation.d.ts +1 -1
- package/types/client/transitionTypes.d.ts +0 -2
- package/types/client/translator.d.ts +2 -0
- package/types/common/codeAgentWire.d.ts +7 -0
- package/types/common/index.d.ts +1 -0
- package/types/common/trimSlashes.d.ts +2 -0
- package/types/common/types.d.ts +1 -1
- package/types/constant/fieldInfo.d.ts +2 -2
- package/types/constant/fieldPlan.d.ts +33 -0
- package/types/constant/index.d.ts +3 -0
- package/types/constant/inputParser.d.ts +11 -0
- package/types/constant/invalidInputError.d.ts +8 -0
- package/types/constant/types.d.ts +1 -1
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +3 -3
- package/types/dictionary/trans.d.ts +3 -0
- package/types/document/database.d.ts +2 -3
- package/types/document/documentSchema.d.ts +1 -1
- package/types/document/noDocumentError.d.ts +6 -1
- package/types/fetch/fetchType/appliedReturn.type.d.ts +3 -1
- package/types/fetch/types.d.ts +2 -2
- package/types/index.d.ts +5 -0
- package/types/server/akanServer.d.ts +1 -1
- package/types/server/artifact/routeSeedMatcher.d.ts +8 -0
- package/types/server/di/diLifecycle.d.ts +1 -0
- package/types/server/index.d.ts +1 -0
- package/types/server/machine/machineAccount.d.ts +1 -0
- package/types/server/machine/machineToken.d.ts +9 -0
- package/types/server/migration/docPath.d.ts +20 -0
- package/types/server/migration/index.d.ts +15 -0
- package/types/server/migration/migrationChangeLog.d.ts +27 -0
- package/types/server/migration/migrationChanges.d.ts +27 -0
- package/types/server/migration/migrationCommand.d.ts +33 -0
- package/types/server/migration/migrationContext.d.ts +28 -0
- package/types/server/migration/migrationDefinition.d.ts +42 -0
- package/types/server/migration/migrationError.d.ts +15 -0
- package/types/server/migration/migrationLedger.d.ts +51 -0
- package/types/server/migration/migrationLock.d.ts +34 -0
- package/types/server/migration/migrationParams.d.ts +41 -0
- package/types/server/migration/migrationPulse.d.ts +15 -0
- package/types/server/migration/migrationRunner.d.ts +93 -0
- package/types/server/migration/migrationScope.d.ts +42 -0
- package/types/server/migration/migrationTable.d.ts +52 -0
- package/types/server/migration/migrations.d.ts +12 -0
- package/types/server/migration.d.ts +1 -0
- package/types/server/ops/opsCommand.d.ts +10 -1
- package/types/server/routeState.d.ts +1 -4
- package/types/server/rscNavigationState.d.ts +2 -3
- package/types/server/rscScrollRestoration.d.ts +14 -0
- package/types/server/sitemap.d.ts +1 -1
- package/types/service/agent.service.d.ts +2 -0
- package/types/service/endpointCacheKeys.d.ts +8 -0
- package/types/service/index.d.ts +1 -0
- package/types/service/injectInfo.d.ts +2 -2
- package/types/service/predefinedAdaptor/anthropicLlm.d.ts +9 -4
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +8 -1
- package/types/service/predefinedAdaptor/documentTransfer.d.ts +1 -0
- package/types/service/predefinedAdaptor/endpointCacheControl.adaptor.d.ts +9 -0
- package/types/service/predefinedAdaptor/index.d.ts +1 -0
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +7 -0
- package/types/service/predefinedAdaptor/openaiDialect.d.ts +20 -5
- package/types/service/predefinedAdaptor/sql/MigrationTables.d.ts +17 -0
- package/types/service/predefinedAdaptor/sql/RawDocumentTable.d.ts +38 -0
- package/types/service/predefinedAdaptor/sql/types.d.ts +1 -0
- package/types/service/predefinedAdaptor/storage.adaptor.d.ts +8 -0
- package/types/signal/endpointCache.d.ts +2 -0
- package/types/signal/endpointErrorContract.d.ts +10 -0
- package/types/signal/endpointIdempotency.d.ts +1 -0
- package/types/signal/endpointRateLimit.d.ts +1 -1
- package/types/signal/exception.d.ts +4 -1
- package/types/signal/index.d.ts +1 -0
- package/types/signal/middlewareChain.d.ts +11 -0
- package/types/signal/signalContext.d.ts +2 -6
- package/types/signal/slice.d.ts +1 -1
- package/types/signal/trace.d.ts +1 -1
- package/types/signal/types.d.ts +12 -0
- package/types/store/action.d.ts +2 -0
- package/types/store/agent/ScreenImage.d.ts +27 -0
- package/types/store/agent/StoreSurfaceSource.d.ts +1 -1
- package/types/store/agent/index.d.ts +2 -1
- package/types/store/databaseStateNames.d.ts +1 -0
- package/types/store/formUploadOf.d.ts +9 -0
- package/types/store/index.d.ts +1 -0
- package/types/store/state.d.ts +7 -1
- package/types/store/stateBuilder.d.ts +2 -1
- package/types/store/storeInstance.d.ts +2 -2
- package/types/store/withSelector.d.ts +1 -1
- package/types/ui/Agent/Composer.d.ts +2 -0
- package/types/ui/Agent/Menu.d.ts +2 -0
- package/types/ui/CsrImage.d.ts +2 -0
- package/types/ui/Data/CardList.d.ts +1 -1
- package/types/ui/Data/Dashboard.d.ts +1 -1
- package/types/ui/Data/Insight.d.ts +1 -1
- package/types/ui/Data/Item.d.ts +2 -2
- package/types/ui/Data/ListContainer.d.ts +1 -1
- package/types/ui/Data/Pagination.d.ts +1 -1
- package/types/ui/Data/TableList.d.ts +1 -1
- package/types/ui/Field/Relation.d.ts +13 -10
- package/types/ui/Field/index.d.ts +4 -4
- package/types/ui/Field/useRelationOptions.d.ts +3 -1
- package/types/ui/Field/useRelationWindow.d.ts +14 -0
- package/types/ui/Image.d.ts +3 -1
- package/types/ui/Load/View.d.ts +1 -1
- package/types/ui/Pagination.d.ts +1 -1
- package/types/ui/Signal/Arg.d.ts +1 -1
- package/types/ui/System/CSR.d.ts +1 -1
- package/types/ui/System/Client.d.ts +1 -1
- package/types/ui/System/SSR.d.ts +1 -1
- package/types/vendor/@akanjs/native/packages/core/src/plugin.d.ts +3 -3
- package/types/vendor/@akanjs/native/packages/desktop/src/page-veto.d.ts +1 -1
- package/types/vendor/@akanjs/native/packages/desktop/src/plugin.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/auth-session/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/auth-session/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/autostart/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/autostart/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/badge/src/desktop.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/badge/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/badge/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/biometric/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/camera/src/desktop.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/camera/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/camera/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/clipboard/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/clipboard/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/clipboard/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/contacts/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/device/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/device/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/device/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/dialog/src/desktop.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/dialog/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/dialog/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/dock/src/desktop.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/dock/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/file-picker/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/file-picker/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/filesystem/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/filesystem/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/haptics/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/haptics/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/http/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/http/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/keep-awake/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/keep-awake/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/keep-awake/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/opener/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/opener/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/opener/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/preferences/src/desktop.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/preferences/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/preferences/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/secure-storage/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/secure-storage/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/share/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/share/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/single-instance/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/splash-screen/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/splash-screen/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/sqlite/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/toast/src/index.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/toast/src/web.d.ts +1 -1
- package/types/vendor/@akanjs/native/plugins/window/src/index.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/window-state/src/desktop.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/window-state/src/index.d.ts +1 -1
- package/types/vendor/use-agentic/Compaction.d.ts +3 -1
- package/types/vendor/use-agentic/Reference.d.ts +9 -1
- package/types/vendor/use-agentic/ToolOutput.d.ts +6 -1
- package/types/vendor/use-agentic/ToolReturn.d.ts +18 -0
- package/types/vendor/use-agentic/Transcript.d.ts +7 -0
- package/types/vendor/use-agentic/index.d.ts +1 -0
- package/types/vendor/use-agentic/types.d.ts +6 -0
- package/types/webkit/useDebounce.d.ts +1 -1
- package/ui/Agent/Chat.tsx +1 -0
- package/ui/Agent/Composer.tsx +2 -0
- package/ui/Agent/Menu.tsx +5 -1
- package/ui/Agent/agentSessionOf.ts +15 -8
- package/ui/Agent/mentionDraft.ts +2 -3
- package/ui/Agent/useReferenceMenu.ts +1 -0
- package/ui/Agent/useSlashMenu.ts +1 -0
- package/ui/Clipboard.tsx +1 -0
- package/ui/CsrImage.tsx +3 -1
- package/ui/Data/CardList.tsx +1 -1
- package/ui/Data/Dashboard.tsx +1 -1
- package/ui/Data/Insight.tsx +1 -1
- package/ui/Data/Item.tsx +5 -2
- package/ui/Data/ListContainer.tsx +2 -2
- package/ui/Data/Pagination.tsx +1 -1
- package/ui/Data/TableList.tsx +1 -1
- package/ui/DraggableList.tsx +1 -0
- package/ui/Field/Collection.tsx +4 -0
- package/ui/Field/Relation.tsx +33 -14
- package/ui/Field/useRelationOptions.ts +33 -5
- package/ui/Field/useRelationWindow.ts +50 -0
- package/ui/Image.tsx +4 -4
- package/ui/Input.tsx +1 -0
- package/ui/Layout/Sider.tsx +1 -1
- package/ui/Link/Anchor.tsx +7 -5
- package/ui/Load/Units.tsx +17 -7
- package/ui/Load/View.tsx +2 -2
- package/ui/Model/Edit.tsx +1 -1
- package/ui/Model/EditModal.tsx +11 -5
- package/ui/Model/New.tsx +1 -1
- package/ui/Model/SureToRemove.tsx +1 -0
- package/ui/Model/ViewEditModal.tsx +17 -5
- package/ui/Model/ViewModal.tsx +2 -2
- package/ui/ObjectId.tsx +5 -1
- package/ui/Pagination.tsx +1 -1
- package/ui/Signal/Arg.tsx +1 -3
- package/ui/Signal/Doc.tsx +5 -1
- package/ui/System/CSR.tsx +1 -1
- package/ui/System/Client.tsx +1 -1
- package/ui/System/Reconnect.tsx +1 -1
- package/ui/System/SSR.tsx +3 -36
- package/ui/ToggleSelect.tsx +2 -0
- package/ui/styles.css +10 -103
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeBridge.swift +3 -2
- package/vendor/@akanjs/native/packages/cli/src/lib/addons.ts +4 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/apk.ts +2 -2
- package/vendor/@akanjs/native/packages/cli/src/lib/codegen.ts +1 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/csp.ts +4 -3
- package/vendor/@akanjs/native/packages/cli/src/lib/googleservices.ts +7 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/hmr.ts +8 -5
- package/vendor/@akanjs/native/packages/cli/src/lib/html.ts +18 -3
- package/vendor/@akanjs/native/packages/cli/src/lib/manifestmerge.ts +1 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/plist.ts +2 -4
- package/vendor/@akanjs/native/packages/cli/src/lib/toolchains.ts +1 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/updates.ts +10 -4
- package/vendor/@akanjs/native/packages/cli/src/lib/xml.ts +4 -3
- package/vendor/@akanjs/native/packages/cli/src/platforms/android.ts +3 -3
- package/vendor/@akanjs/native/packages/core/src/kernel.ts +3 -3
- package/vendor/@akanjs/native/packages/core/src/live.ts +1 -0
- package/vendor/@akanjs/native/packages/core/src/plugin.ts +5 -3
- package/vendor/@akanjs/native/packages/desktop/src/host.ts +13 -5
- package/vendor/@akanjs/native/packages/desktop/src/lifecycle.ts +1 -0
- package/vendor/@akanjs/native/packages/desktop/src/page-veto.ts +1 -1
- package/vendor/@akanjs/native/packages/desktop/src/plugin.ts +4 -1
- package/vendor/@akanjs/native/plugins/camera/src/web.ts +3 -3
- package/vendor/@akanjs/native/plugins/file-picker/src/index.ts +4 -1
- package/vendor/@akanjs/native/plugins/local-notifications/src/web.ts +1 -1
- package/vendor/@akanjs/native/plugins/secure-storage/src/desktop.ts +1 -1
- package/vendor/@akanjs/native/plugins/share/src/options.ts +1 -1
- package/vendor/@akanjs/native/plugins/single-instance/src/desktop.ts +3 -2
- package/vendor/@akanjs/native/plugins/updates/src/desktop.ts +4 -1
- package/vendor/@akanjs/native/plugins/window/src/index.ts +2 -2
- package/vendor/use-agentic/Compaction.ts +38 -7
- package/vendor/use-agentic/Reference.ts +16 -9
- package/vendor/use-agentic/ToolOutput.ts +25 -3
- package/vendor/use-agentic/ToolReturn.ts +32 -0
- package/vendor/use-agentic/ToolRunner.ts +15 -13
- package/vendor/use-agentic/Transcript.ts +38 -2
- package/vendor/use-agentic/WIRE.md +20 -0
- package/vendor/use-agentic/index.ts +1 -0
- package/vendor/use-agentic/types.ts +6 -0
- package/webkit/McpAppAgent.ts +12 -2
- package/webkit/RenderLayer.tsx +23 -4
- package/webkit/useDebounce.ts +23 -14
- package/client/viewTransition.ts +0 -10
- package/types/client/viewTransition.d.ts +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpSpec } from "./index.ts";
|
|
2
2
|
/** `send` is replaceable for tests; the default is Bun's fetch. */
|
|
3
|
-
export declare function createDesktopHttp(send?: typeof fetch): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<HttpSpec,
|
|
4
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<HttpSpec,
|
|
3
|
+
export declare function createDesktopHttp(send?: typeof fetch): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<HttpSpec, Record<never, never>>;
|
|
4
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<HttpSpec, Record<never, never>>;
|
|
5
5
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { HttpSpec } from "./index.ts";
|
|
2
|
-
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<HttpSpec,
|
|
2
|
+
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<HttpSpec, Record<never, never>>;
|
|
@@ -10,6 +10,6 @@ export type Spawner = (argv: string[]) => Child;
|
|
|
10
10
|
* `spawn` is replaceable so tests can check the command without keeping the Mac awake, `platform`
|
|
11
11
|
* so they can check the shell ops of Windows and Linux on any OS.
|
|
12
12
|
*/
|
|
13
|
-
export declare function createDesktopKeepAwake(spawn?: Spawner, pid?: number, platform?: NodeJS.Platform): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<KeepAwakeApi,
|
|
14
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<KeepAwakeApi,
|
|
13
|
+
export declare function createDesktopKeepAwake(spawn?: Spawner, pid?: number, platform?: NodeJS.Platform): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<KeepAwakeApi, Record<never, never>>;
|
|
14
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<KeepAwakeApi, Record<never, never>>;
|
|
15
15
|
export default _default;
|
|
@@ -22,7 +22,7 @@ export interface KeepAwakeApi {
|
|
|
22
22
|
value: boolean;
|
|
23
23
|
}>;
|
|
24
24
|
}
|
|
25
|
-
export declare const keepAwake: import("../../../packages/core/src/plugin.ts").Plugin<KeepAwakeApi,
|
|
25
|
+
export declare const keepAwake: import("../../../packages/core/src/plugin.ts").Plugin<KeepAwakeApi, Record<never, never>>;
|
|
26
26
|
/**
|
|
27
27
|
* Keeps the screen on until the returned function is called (once per holder). The first holder
|
|
28
28
|
* calls keepAwake, the last release calls allowSleep. Do not mix with direct keepAwake()/allowSleep()
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { KeepAwakeApi } from "./index.ts";
|
|
2
|
-
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<KeepAwakeApi,
|
|
2
|
+
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<KeepAwakeApi, Record<never, never>>;
|
|
@@ -9,6 +9,6 @@ export type Runner = (argv: string[]) => Promise<Command>;
|
|
|
9
9
|
* `run` is replaceable so tests can check the commands without opening anything, `platform` so
|
|
10
10
|
* they can check the Windows and Linux paths (shell ops) on any OS.
|
|
11
11
|
*/
|
|
12
|
-
export declare function createDesktopOpener(run?: Runner, platform?: NodeJS.Platform): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<OpenerApi,
|
|
13
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<OpenerApi,
|
|
12
|
+
export declare function createDesktopOpener(run?: Runner, platform?: NodeJS.Platform): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<OpenerApi, Record<never, never>>;
|
|
13
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<OpenerApi, Record<never, never>>;
|
|
14
14
|
export default _default;
|
|
@@ -30,4 +30,4 @@ export interface OpenerApi {
|
|
|
30
30
|
*/
|
|
31
31
|
openSettings(): Promise<void>;
|
|
32
32
|
}
|
|
33
|
-
export declare const opener: import("../../../packages/core/src/plugin.ts").Plugin<OpenerApi,
|
|
33
|
+
export declare const opener: import("../../../packages/core/src/plugin.ts").Plugin<OpenerApi, Record<never, never>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { OpenerApi } from "./index.ts";
|
|
2
|
-
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<OpenerApi,
|
|
2
|
+
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<OpenerApi, Record<never, never>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PreferencesApi } from "./index.ts";
|
|
2
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<PreferencesApi,
|
|
2
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<PreferencesApi, Record<never, never>>;
|
|
3
3
|
export default _default;
|
|
@@ -17,7 +17,7 @@ export interface PreferencesApi {
|
|
|
17
17
|
}>;
|
|
18
18
|
clear(): Promise<void>;
|
|
19
19
|
}
|
|
20
|
-
export declare const preferences: import("../../../packages/core/src/plugin.ts").Plugin<PreferencesApi,
|
|
20
|
+
export declare const preferences: import("../../../packages/core/src/plugin.ts").Plugin<PreferencesApi, Record<never, never>>;
|
|
21
21
|
export type PreferenceSetter = (value: string | null) => Promise<void>;
|
|
22
22
|
/**
|
|
23
23
|
* Reads and writes one key. `ready` is false until the stored value has loaded.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PreferencesApi } from "./index.ts";
|
|
2
|
-
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<PreferencesApi,
|
|
2
|
+
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<PreferencesApi, Record<never, never>>;
|
|
@@ -11,6 +11,6 @@ export declare function quoteForSecurity(text: string): string;
|
|
|
11
11
|
export declare function encrypt(key: Buffer, name: string, value: string): string;
|
|
12
12
|
/** null when the entry was written with another key, for another name, or is damaged. */
|
|
13
13
|
export declare function decrypt(key: Buffer, name: string, blob: string): string | null;
|
|
14
|
-
export declare function createDesktopSecureStorage(options?: DesktopSecureStorageOptions): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SecureStorageApi,
|
|
15
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SecureStorageApi,
|
|
14
|
+
export declare function createDesktopSecureStorage(options?: DesktopSecureStorageOptions): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SecureStorageApi, Record<never, never>>;
|
|
15
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SecureStorageApi, Record<never, never>>;
|
|
16
16
|
export default _default;
|
|
@@ -36,4 +36,4 @@ export interface SecureStorageApi {
|
|
|
36
36
|
/** Removes every key of this app. */
|
|
37
37
|
clear(): Promise<void>;
|
|
38
38
|
}
|
|
39
|
-
export declare const secureStorage: import("../../../packages/core/src/plugin.ts").Plugin<SecureStorageApi,
|
|
39
|
+
export declare const secureStorage: import("../../../packages/core/src/plugin.ts").Plugin<SecureStorageApi, Record<never, never>>;
|
|
@@ -42,7 +42,7 @@ export interface ShareApi {
|
|
|
42
42
|
value: boolean;
|
|
43
43
|
}>;
|
|
44
44
|
}
|
|
45
|
-
export declare const share: import("../../../packages/core/src/plugin.ts").Plugin<ShareApi,
|
|
45
|
+
export declare const share: import("../../../packages/core/src/plugin.ts").Plugin<ShareApi, Record<never, never>>;
|
|
46
46
|
export interface UseShare {
|
|
47
47
|
/** False where no share sheet exists (desktop Firefox, insecure origins): hide the share button. */
|
|
48
48
|
supported: boolean;
|
|
@@ -2,4 +2,4 @@ import type { ShareApi } from "./index.ts";
|
|
|
2
2
|
export declare function webShareAvailable(): boolean;
|
|
3
3
|
/** A file name for the share target: the URL's last path segment if it has an extension. */
|
|
4
4
|
export declare function fileName(url: string, mime: string, index: number, base?: string): string;
|
|
5
|
-
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<ShareApi,
|
|
5
|
+
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<ShareApi, Record<never, never>>;
|
|
@@ -3,6 +3,6 @@ export declare function createDesktopSingleInstance(options?: {
|
|
|
3
3
|
path?: (appId: string) => string;
|
|
4
4
|
args?: () => string[];
|
|
5
5
|
cwd?: () => string;
|
|
6
|
-
}): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<
|
|
7
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<
|
|
6
|
+
}): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<Record<never, never>, SingleInstanceEvents>;
|
|
7
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<Record<never, never>, SingleInstanceEvents>;
|
|
8
8
|
export default _default;
|
|
@@ -16,4 +16,4 @@ export interface SplashScreenApi {
|
|
|
16
16
|
fadeOutDuration?: number;
|
|
17
17
|
}): Promise<void>;
|
|
18
18
|
}
|
|
19
|
-
export declare const splashScreen: import("../../../packages/core/src/plugin.ts").Plugin<SplashScreenApi,
|
|
19
|
+
export declare const splashScreen: import("../../../packages/core/src/plugin.ts").Plugin<SplashScreenApi, Record<never, never>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SplashScreenApi } from "./index.ts";
|
|
2
2
|
/** Browsers and the desktop WebView have no splash to hide. Arguments are still checked. */
|
|
3
|
-
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<SplashScreenApi,
|
|
3
|
+
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<SplashScreenApi, Record<never, never>>;
|
|
4
4
|
export declare function checkFade(value: unknown): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DesktopContext } from "../../../packages/desktop/src/plugin.ts";
|
|
2
2
|
import type { SqliteSpec } from "./index.ts";
|
|
3
3
|
/** `dir` is replaceable so tests can use a temporary folder. */
|
|
4
|
-
export declare function createDesktopSqlite(dir?: (ctx: DesktopContext) => string): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SqliteSpec,
|
|
5
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SqliteSpec,
|
|
4
|
+
export declare function createDesktopSqlite(dir?: (ctx: DesktopContext) => string): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SqliteSpec, Record<never, never>>;
|
|
5
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<SqliteSpec, Record<never, never>>;
|
|
6
6
|
export default _default;
|
|
@@ -27,4 +27,4 @@ export interface ToastApi {
|
|
|
27
27
|
*/
|
|
28
28
|
show(options: ToastShowOptions): Promise<void>;
|
|
29
29
|
}
|
|
30
|
-
export declare const toast: import("../../../packages/core/src/plugin.ts").Plugin<ToastApi,
|
|
30
|
+
export declare const toast: import("../../../packages/core/src/plugin.ts").Plugin<ToastApi, Record<never, never>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToastApi } from "./index.ts";
|
|
2
|
-
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<ToastApi,
|
|
2
|
+
export declare const web: import("../../../packages/core/src/plugin.ts").WebPlugin<ToastApi, Record<never, never>>;
|
|
@@ -226,9 +226,9 @@ export declare function useWindowState(): WindowState | null;
|
|
|
226
226
|
* none prevents it, the window closes as usual. Desktop only: elsewhere it never fires
|
|
227
227
|
* (`appWindow.eventImplementation("closeRequested")` tells). Returns an unregister function.
|
|
228
228
|
*/
|
|
229
|
-
export declare const onCloseRequested: (handler: VetoHandler<
|
|
229
|
+
export declare const onCloseRequested: (handler: VetoHandler<Record<never, never>>) => () => void;
|
|
230
230
|
/** onCloseRequested while mounted; always calls the latest handler. */
|
|
231
|
-
export declare function useCloseRequested(handler: VetoHandler<
|
|
231
|
+
export declare function useCloseRequested(handler: VetoHandler<Record<never, never>>): void;
|
|
232
232
|
/** Files dragged over this window (desktop). Returns an unsubscribe function; never fires on web or mobile. */
|
|
233
233
|
export declare function onDragDrop(handler: (event: DragDropEvent) => void): () => void;
|
|
234
234
|
export {};
|
|
@@ -2,6 +2,6 @@ import type { WindowStateApi } from "./index.ts";
|
|
|
2
2
|
export declare const STATE_FILE = "window-state.json";
|
|
3
3
|
export declare function createDesktopWindowState(options?: {
|
|
4
4
|
delay?: number;
|
|
5
|
-
}): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<WindowStateApi,
|
|
6
|
-
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<WindowStateApi,
|
|
5
|
+
}): import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<WindowStateApi, Record<never, never>>;
|
|
6
|
+
declare const _default: import("../../../packages/desktop/src/plugin.ts").DesktopPlugin<WindowStateApi, Record<never, never>>;
|
|
7
7
|
export default _default;
|
|
@@ -30,4 +30,4 @@ export interface WindowStateApi {
|
|
|
30
30
|
/** Forgets the saved state: the next launch uses the configured size again. */
|
|
31
31
|
clear(): Promise<void>;
|
|
32
32
|
}
|
|
33
|
-
export declare const windowState: import("../../../packages/core/src/plugin.ts").Plugin<WindowStateApi,
|
|
33
|
+
export declare const windowState: import("../../../packages/core/src/plugin.ts").Plugin<WindowStateApi, Record<never, never>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessage, TurnLimits } from "./types.d.ts";
|
|
1
|
+
import type { ChatMessage, ToolCallResult, TurnLimits } from "./types.d.ts";
|
|
2
2
|
export interface CompactOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Estimated transcript tokens above which a turn summarizes its own history first — a ceiling on what each turn
|
|
@@ -50,6 +50,8 @@ export declare class Compaction {
|
|
|
50
50
|
* more than the slack the estimate leaves.
|
|
51
51
|
*/
|
|
52
52
|
static tokensOf(messages: readonly ChatMessage[]): number;
|
|
53
|
+
/** One tool result as it rides the wire, by the same rule. */
|
|
54
|
+
static resultTokensOf(result: ToolCallResult): number;
|
|
53
55
|
/**
|
|
54
56
|
* What the next request is estimated to cost, prompt and all: the provider's own count for the last turn that
|
|
55
57
|
* reported one, plus four characters a token for what the transcript gained since. The provider's number is the
|
|
@@ -31,10 +31,18 @@ export declare class Reference {
|
|
|
31
31
|
*
|
|
32
32
|
* The text is the source of truth for which references a message carries — deleting the token is how somebody
|
|
33
33
|
* takes one back — so the token has to say everything the pointer does. The value is looked up beside it by key.
|
|
34
|
+
* A label's `\`, `[` and `]` are backslash-escaped, as in a markdown link: titles like "[Ops] Minutes" are common.
|
|
34
35
|
*/
|
|
35
36
|
static token(reference: MessageReference): string;
|
|
36
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Greedy on the label alone: a label may hold an escaped `\\`, `\[` or `\]`, a backslash escaping nothing (a token
|
|
39
|
+
* written before labels were escaped), and anything else but `]` or an `@[`, where a token starts over. No two
|
|
40
|
+
* alternatives match at the same place, so a long run cannot backtrack. Every other part is a name, an id or a
|
|
41
|
+
* dotted path, none of which holds a bracket.
|
|
42
|
+
*/
|
|
37
43
|
static readonly pattern: RegExp;
|
|
44
|
+
/** The pointer one match of `pattern` names, its label unescaped. */
|
|
45
|
+
static pointerOf([, label, refName, refId, path]: RegExpMatchArray): MessageReference;
|
|
38
46
|
/**
|
|
39
47
|
* The pointers a draft names, in the order it names them. Pointers only — the value lives in `staged` and is
|
|
40
48
|
* joined on by key, so reading the text can never resurrect a value somebody deleted the token for.
|
|
@@ -10,12 +10,17 @@ import type { ToolCallResult } from "./types.d.ts";
|
|
|
10
10
|
*
|
|
11
11
|
* Clipped rather than dropped, and the note says what happened: a model handed a value it cannot see the end of
|
|
12
12
|
* asks a narrower question, where one handed nothing answers from the field names.
|
|
13
|
+
*
|
|
14
|
+
* A file the call attached is bounded apart: a picture is billed by its pixels, not by the length of its base64, so
|
|
15
|
+
* counting it as characters would clip every one. It meets the per-file ceiling a user's attachment meets instead.
|
|
13
16
|
*/
|
|
14
17
|
export declare class ToolOutput {
|
|
15
18
|
#private;
|
|
16
19
|
/** Characters, ~5k tokens: comfortably above `ScreenReader.limit` and far below any provider's window. */
|
|
17
20
|
static readonly limit = 20000;
|
|
18
|
-
/**
|
|
21
|
+
/** Bytes of one attached file, as `maxAttachmentBytes` bounds a user's: a provider refuses a turn past it. */
|
|
22
|
+
static readonly attachmentBytes: number;
|
|
23
|
+
/** The estimate `Compaction` places: four characters per token over the JSON, and a flat rate per picture. */
|
|
19
24
|
static tokensOf(result: ToolCallResult): number;
|
|
20
25
|
static clipped(result: ToolCallResult): ToolCallResult;
|
|
21
26
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MessageAttachment } from "./types.d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* What a tool's `run` returns when its answer includes files beside the value: `ToolReturn.attach(result, files)`.
|
|
4
|
+
* `ToolRunner` lifts the files into `ToolCallResult.attachments`, which a backend hands the model as content.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ToolReturn {
|
|
7
|
+
#private;
|
|
8
|
+
/** Interned, not an `instanceof`: one page can hold several bundled copies of this package. */
|
|
9
|
+
static readonly brand: unique symbol;
|
|
10
|
+
readonly result: unknown;
|
|
11
|
+
readonly attachments: MessageAttachment[];
|
|
12
|
+
constructor(result: unknown, attachments: MessageAttachment[]);
|
|
13
|
+
static attach(result: unknown, attachments: MessageAttachment[]): ToolReturn;
|
|
14
|
+
static split(value: unknown): {
|
|
15
|
+
result: unknown;
|
|
16
|
+
attachments: MessageAttachment[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -10,9 +10,16 @@ import type { ChatMessage } from "./types.d.ts";
|
|
|
10
10
|
* transcript is assembled rather than where each hole is made.
|
|
11
11
|
*/
|
|
12
12
|
export declare class Transcript {
|
|
13
|
+
#private;
|
|
13
14
|
static readonly unanswered = "The turn was stopped before this call ran.";
|
|
14
15
|
/** What one turn posts: no host-only message, no unanswered call, no result answering a call nobody sees. */
|
|
15
16
|
static wire(messages: readonly ChatMessage[]): ChatMessage[];
|
|
17
|
+
/**
|
|
18
|
+
* A file a tool returned before the user's latest message, as a note in its place. A picture costs a turn over a
|
|
19
|
+
* thousand tokens and would ride every turn after the one that asked for it; a later question about it calls the
|
|
20
|
+
* tool again, which is why the note says to — and to do it while the picture is on screen, where a tool can reach it.
|
|
21
|
+
*/
|
|
22
|
+
static seen(messages: readonly ChatMessage[]): ChatMessage[];
|
|
16
23
|
/** A message without the provider's count for its turn — what the wire carries and what a compaction keeps. */
|
|
17
24
|
static unmeasured(message: ChatMessage): ChatMessage;
|
|
18
25
|
static sanitize(messages: readonly ChatMessage[]): ChatMessage[];
|
|
@@ -13,6 +13,7 @@ export * from "./Reference.d.ts";
|
|
|
13
13
|
export * from "./sharedContext.d.ts";
|
|
14
14
|
export * from "./surfaceContext.d.ts";
|
|
15
15
|
export * from "./ToolOutput.d.ts";
|
|
16
|
+
export * from "./ToolReturn.d.ts";
|
|
16
17
|
export * from "./ToolRunner.d.ts";
|
|
17
18
|
export * from "./Transcript.d.ts";
|
|
18
19
|
export * from "./types.d.ts";
|
|
@@ -144,6 +144,12 @@ export interface ToolCallResult {
|
|
|
144
144
|
/** What the call changed on the surface — the whole report for a tool that returns nothing. */
|
|
145
145
|
changes?: ResourceDiff[];
|
|
146
146
|
error?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Files the call handed the model — a picture it looked at — in the shape a user's attachment takes. A `result`
|
|
149
|
+
* cannot carry one: it reaches the model as JSON text, so a URL is read as letters and base64 as a wall of them.
|
|
150
|
+
* Outside the `ToolOutput` ceiling, and only the latest turn's ride the wire as bytes (`Transcript.wire`).
|
|
151
|
+
*/
|
|
152
|
+
attachments?: MessageAttachment[];
|
|
147
153
|
}
|
|
148
154
|
/**
|
|
149
155
|
* Why an assistant turn ended. `length` is the provider's own ceiling rather than the model's choice, so the turn
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDebounce: <Args extends unknown[], Return>(callback: (...args: Args) => Return,
|
|
1
|
+
export declare const useDebounce: <Args extends unknown[], Return>(callback: (...args: Args) => Return, _states?: unknown[], wait?: number) => (...args: Args) => void;
|
package/ui/Agent/Chat.tsx
CHANGED
|
@@ -533,6 +533,7 @@ export const DefaultChat = ({
|
|
|
533
533
|
draft={draft}
|
|
534
534
|
handleRef={handleRef}
|
|
535
535
|
inputRef={inputRef}
|
|
536
|
+
isMenuOpen={!!list.at()}
|
|
536
537
|
mentions={mentions ?? !!reference?.length}
|
|
537
538
|
{...(speech.canListen ? { mic: { listening: speech.listening, onToggle: speech.toggle } } : {})}
|
|
538
539
|
onDraft={write}
|
package/ui/Agent/Composer.tsx
CHANGED
|
@@ -39,6 +39,8 @@ export interface ComposerProps {
|
|
|
39
39
|
inputRef?: RefObject<HTMLTextAreaElement | null>;
|
|
40
40
|
/** Draws each `@` pointer as its name; set only when the chat has `reference` sources. */
|
|
41
41
|
mentions?: boolean;
|
|
42
|
+
/** A `/` or `@` menu is up and `onKeyDown` picks from it: an override that takes Enter for a newline passes it on. */
|
|
43
|
+
isMenuOpen?: boolean;
|
|
42
44
|
/** Filled by whichever input is drawn. An override that draws its own textarea leaves it null and `inputRef` answers. */
|
|
43
45
|
handleRef?: RefObject<ComposerHandle | null>;
|
|
44
46
|
}
|
package/ui/Agent/Menu.tsx
CHANGED
|
@@ -3,6 +3,8 @@ import { cn } from "akanjs/client";
|
|
|
3
3
|
import { createOverridable } from "../UiOverride";
|
|
4
4
|
|
|
5
5
|
export interface MenuRow {
|
|
6
|
+
/** Unique among the rows; `name` repeats when two records share a title. */
|
|
7
|
+
id: string;
|
|
6
8
|
name: string;
|
|
7
9
|
description?: string;
|
|
8
10
|
/** The argument names a row takes. */
|
|
@@ -36,8 +38,10 @@ export const DefaultAgentMenu = ({ className, rows, selected, prefix = "/", onPi
|
|
|
36
38
|
"flex items-baseline gap-2 px-4 py-1.5 text-left hover:bg-muted",
|
|
37
39
|
idx === selected && "bg-muted",
|
|
38
40
|
)}
|
|
39
|
-
key={row.
|
|
41
|
+
key={row.id}
|
|
40
42
|
onClick={() => onPick(row)}
|
|
43
|
+
|
|
44
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
41
45
|
role="option"
|
|
42
46
|
type="button"
|
|
43
47
|
>
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
type AgentSessionOptions,
|
|
15
15
|
type ChatMessage,
|
|
16
16
|
type CompactOptions,
|
|
17
|
+
type MessageAttachment,
|
|
17
18
|
type SessionHistory,
|
|
18
19
|
type SurfaceView,
|
|
19
20
|
Transcript,
|
|
@@ -100,18 +101,24 @@ export const sessionView = (surface: AgenticSurface, path: string[], builtins?:
|
|
|
100
101
|
const restoredValue =
|
|
101
102
|
"the conversation was restored from storage, which keeps what the user pointed at but not the value it held";
|
|
102
103
|
|
|
104
|
+
const pointerOf = ({ name, mimeType, url, ref }: MessageAttachment): MessageAttachment => ({
|
|
105
|
+
name,
|
|
106
|
+
mimeType,
|
|
107
|
+
...(url ? { url } : {}),
|
|
108
|
+
...(ref ? { ref } : {}),
|
|
109
|
+
});
|
|
110
|
+
|
|
103
111
|
const withoutContent = (message: ChatMessage): ChatMessage => {
|
|
104
|
-
|
|
112
|
+
const toolFiles = message.toolResults?.some((result) => result.attachments?.length);
|
|
113
|
+
if (!message.attachments?.length && !message.references?.length && !toolFiles) return message;
|
|
105
114
|
return {
|
|
106
115
|
...message,
|
|
107
|
-
...(message.attachments?.length
|
|
116
|
+
...(message.attachments?.length ? { attachments: message.attachments.map(pointerOf) } : {}),
|
|
117
|
+
...(toolFiles
|
|
108
118
|
? {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
...(url ? { url } : {}),
|
|
113
|
-
...(ref ? { ref } : {}),
|
|
114
|
-
})),
|
|
119
|
+
toolResults: message.toolResults?.map((result) =>
|
|
120
|
+
result.attachments?.length ? { ...result, attachments: result.attachments.map(pointerOf) } : result,
|
|
121
|
+
),
|
|
115
122
|
}
|
|
116
123
|
: {}),
|
|
117
124
|
...(message.references?.length
|
package/ui/Agent/mentionDraft.ts
CHANGED
|
@@ -32,10 +32,9 @@ export class MentionDraft {
|
|
|
32
32
|
|
|
33
33
|
const pattern = new RegExp(Reference.pattern.source, "g");
|
|
34
34
|
for (let match = pattern.exec(text); match; match = pattern.exec(text)) {
|
|
35
|
-
const [token, label, refName, refId, path] = match;
|
|
36
35
|
if (match.index > at) nodes.push(...MentionDraft.#plain(text.slice(at, match.index)));
|
|
37
|
-
nodes.push($createMentionNode(
|
|
38
|
-
at = match.index +
|
|
36
|
+
nodes.push($createMentionNode(Reference.pointerOf(match)));
|
|
37
|
+
at = match.index + match[0].length;
|
|
39
38
|
}
|
|
40
39
|
if (at < text.length) nodes.push(...MentionDraft.#plain(text.slice(at)));
|
|
41
40
|
return nodes;
|
|
@@ -68,6 +68,7 @@ export const useReferenceMenu = ({ draft, sources, session, l, onWrite }: Refere
|
|
|
68
68
|
setRows(
|
|
69
69
|
found.flatMap((candidates, at) =>
|
|
70
70
|
candidates.map((candidate) => ({
|
|
71
|
+
id: `${current[at].refName}/${candidate.refId}`,
|
|
71
72
|
name: candidate.label,
|
|
72
73
|
description: candidate.description ?? current[at].label,
|
|
73
74
|
pick: () => write(candidate, current[at]),
|
package/ui/Agent/useSlashMenu.ts
CHANGED
|
@@ -19,6 +19,7 @@ export const useSlashMenu = ({ draft, l, onCommand }: SlashMenuSetup) => {
|
|
|
19
19
|
? ChatCommands.list(l)
|
|
20
20
|
.filter((command) => `/${command.name}`.startsWith(query))
|
|
21
21
|
.map((command) => ({
|
|
22
|
+
id: command.name,
|
|
22
23
|
name: command.name,
|
|
23
24
|
description: command.description,
|
|
24
25
|
pick: () => onCommand(command),
|
package/ui/Clipboard.tsx
CHANGED
package/ui/CsrImage.tsx
CHANGED
|
@@ -13,6 +13,8 @@ type CsrImageProps = Omit<ImgHTMLAttributes<HTMLImageElement>, "alt" | "src"> &
|
|
|
13
13
|
quality?: number;
|
|
14
14
|
unoptimized?: boolean;
|
|
15
15
|
fill?: boolean;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
blurDataURL?: string;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const EMPTY_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
@@ -24,7 +26,7 @@ export const CsrImage = ({ src, alt, file, className, abstractData, ...props }:
|
|
|
24
26
|
const defaultAbstractData =
|
|
25
27
|
"data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFklEQVR42mN8//HLfwYiAOOoQvoqBABbWyZJf74GZgAAAABJRU5ErkJggg==";
|
|
26
28
|
const blurDataURL = abstractData ?? file?.abstractData ?? defaultAbstractData;
|
|
27
|
-
const { priority, preload, quality, unoptimized, fill, ...csrProps } = props;
|
|
29
|
+
const { priority, preload, quality, unoptimized, fill, placeholder, blurDataURL: _blurDataURL, ...csrProps } = props;
|
|
28
30
|
return (
|
|
29
31
|
<img
|
|
30
32
|
src={url ?? EMPTY_IMAGE}
|
package/ui/Data/CardList.tsx
CHANGED
|
@@ -14,7 +14,7 @@ import DataPagination from "./Pagination";
|
|
|
14
14
|
|
|
15
15
|
const gridClassName = "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4";
|
|
16
16
|
|
|
17
|
-
type DataItemProps<T extends string,
|
|
17
|
+
type DataItemProps<T extends string, _M extends { id: string }, L extends { id: string }> = {
|
|
18
18
|
[key in T]: L;
|
|
19
19
|
} & { slice: SliceMeta };
|
|
20
20
|
|
package/ui/Data/Dashboard.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { useState } from "react";
|
|
|
7
7
|
|
|
8
8
|
import { dictLabel, formatStat } from "./dataText";
|
|
9
9
|
|
|
10
|
-
export interface DashboardProps<
|
|
10
|
+
export interface DashboardProps<_T extends string, _State> {
|
|
11
11
|
className?: string;
|
|
12
12
|
summary: Record<string, unknown>;
|
|
13
13
|
/** The listing these tiles belong to. Kept so a caller names its target; the labels are app-level keys. */
|
package/ui/Data/Insight.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import type { SliceMeta } from "akanjs/fetch";
|
|
|
4
4
|
|
|
5
5
|
import { dictLabel, formatStat } from "./dataText";
|
|
6
6
|
|
|
7
|
-
interface InsightProps<
|
|
7
|
+
interface InsightProps<_T extends string, Insight> {
|
|
8
8
|
className?: string;
|
|
9
9
|
insight: Insight;
|
|
10
10
|
slice: SliceMeta;
|
package/ui/Data/Item.tsx
CHANGED
|
@@ -68,7 +68,7 @@ export const convToAntdColumn = (column: DataColumn<any>) => {
|
|
|
68
68
|
else return { key: column, dataIndex: column, title: capitalize(column), render: renderCell };
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
interface ItemProps<
|
|
71
|
+
interface ItemProps<_T extends string, _Full extends { id: string }, Light extends { id: string }> {
|
|
72
72
|
className?: string;
|
|
73
73
|
model: Light;
|
|
74
74
|
slice: SliceMeta;
|
|
@@ -166,7 +166,7 @@ export default function Item<T extends string, Full extends { id: string }, Ligh
|
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
interface ActionProps<
|
|
169
|
+
interface ActionProps<_T extends string, _M extends { id: string }, L extends { id: string }> {
|
|
170
170
|
action: DataAction;
|
|
171
171
|
model: L;
|
|
172
172
|
slice: SliceMeta;
|
|
@@ -194,6 +194,7 @@ export const Action = <T extends string, M extends { id: string }, L extends { i
|
|
|
194
194
|
};
|
|
195
195
|
return action === "edit" ? (
|
|
196
196
|
<button
|
|
197
|
+
type="button"
|
|
197
198
|
className={buttonRecipe({ variant: outline ? "outline" : "ghost", size: "icon" }, [
|
|
198
199
|
"m-1 size-8 text-center",
|
|
199
200
|
outline && "border-dashed",
|
|
@@ -204,6 +205,7 @@ export const Action = <T extends string, M extends { id: string }, L extends { i
|
|
|
204
205
|
</button>
|
|
205
206
|
) : action === "view" ? (
|
|
206
207
|
<button
|
|
208
|
+
type="button"
|
|
207
209
|
className={buttonRecipe({ variant: outline ? "outline" : "ghost", size: "icon" }, [
|
|
208
210
|
"m-1 size-8 text-center",
|
|
209
211
|
outline && "border-dashed",
|
|
@@ -219,6 +221,7 @@ export const Action = <T extends string, M extends { id: string }, L extends { i
|
|
|
219
221
|
onConfirm={() => void storeDo[namesOfSlice.removeModel](model.id)}
|
|
220
222
|
>
|
|
221
223
|
<button
|
|
224
|
+
type="button"
|
|
222
225
|
className={buttonRecipe({ variant: outline ? "outline" : "ghost", size: "icon" }, [
|
|
223
226
|
"m-1 size-8 text-center",
|
|
224
227
|
outline && "border-dashed",
|
|
@@ -44,8 +44,8 @@ const pageLimits = [10, 20, 50, 100];
|
|
|
44
44
|
const menuItemClassName = "flex w-full flex-nowrap justify-start gap-2";
|
|
45
45
|
|
|
46
46
|
export interface ListContainerProps<
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
_T extends string,
|
|
48
|
+
_State,
|
|
49
49
|
Input,
|
|
50
50
|
Full extends { id: string },
|
|
51
51
|
Light extends { id: string },
|
package/ui/Data/Pagination.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { usePageTool } from "akanjs/webkit";
|
|
|
8
8
|
import { Pagination as Pagn } from "../Pagination";
|
|
9
9
|
import { sliceNamesOf } from "../sliceNamesOf";
|
|
10
10
|
|
|
11
|
-
interface PaginationProps<
|
|
11
|
+
interface PaginationProps<_T extends string> {
|
|
12
12
|
className?: string;
|
|
13
13
|
slice: SliceMeta;
|
|
14
14
|
}
|
package/ui/Data/TableList.tsx
CHANGED
package/ui/DraggableList.tsx
CHANGED
|
@@ -183,6 +183,7 @@ const Item = ({
|
|
|
183
183
|
{children}
|
|
184
184
|
{removable && (
|
|
185
185
|
<button
|
|
186
|
+
type="button"
|
|
186
187
|
className={recipe({ variant: "outline", size: "xs" }, [
|
|
187
188
|
"size-6 border-destructive p-0 text-destructive hover:bg-destructive hover:text-destructive-foreground",
|
|
188
189
|
removeClassName,
|