@harperfast/harper 5.3.0-beta.3 → 5.3.0-beta.4
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/bin/cliOperations.ts +25 -3
- package/bin/run.ts +18 -0
- package/components/Application.ts +52 -78
- package/components/DESIGN.md +76 -3
- package/components/Scope.ts +10 -4
- package/components/anthropic/index.ts +10 -1
- package/components/bedrock/index.ts +10 -1
- package/components/componentLoader.ts +23 -14
- package/components/mcp/tools/operations.ts +3 -1
- package/components/ollama/index.ts +10 -1
- package/components/openai/index.ts +265 -18
- package/components/operations.js +40 -1
- package/config/configUtils.ts +3 -19
- package/dataLayer/DESIGN.md +29 -5
- package/dataLayer/harperBridge/ResourceBridge.ts +39 -3
- package/dataLayer/restoreMarker.ts +250 -14
- package/dataLayer/schema.ts +2 -7
- package/dataLayer/schemaDescribe.ts +10 -0
- package/dist/bin/cliOperations.js +28 -3
- package/dist/bin/cliOperations.js.map +1 -1
- package/dist/bin/run.js +19 -0
- package/dist/bin/run.js.map +1 -1
- package/dist/components/Application.d.ts +8 -2
- package/dist/components/Application.js +43 -69
- package/dist/components/Application.js.map +1 -1
- package/dist/components/Scope.d.ts +1 -1
- package/dist/components/Scope.js +9 -4
- package/dist/components/Scope.js.map +1 -1
- package/dist/components/anthropic/index.d.ts +0 -10
- package/dist/components/anthropic/index.js +9 -1
- package/dist/components/anthropic/index.js.map +1 -1
- package/dist/components/bedrock/index.d.ts +0 -12
- package/dist/components/bedrock/index.js +9 -1
- package/dist/components/bedrock/index.js.map +1 -1
- package/dist/components/componentLoader.js +23 -14
- package/dist/components/componentLoader.js.map +1 -1
- package/dist/components/mcp/tools/operations.js +1 -1
- package/dist/components/mcp/tools/operations.js.map +1 -1
- package/dist/components/ollama/index.d.ts +0 -13
- package/dist/components/ollama/index.js +9 -1
- package/dist/components/ollama/index.js.map +1 -1
- package/dist/components/openai/index.d.ts +11 -15
- package/dist/components/openai/index.js +224 -12
- package/dist/components/openai/index.js.map +1 -1
- package/dist/components/operations.d.ts +9 -0
- package/dist/components/operations.js +32 -2
- package/dist/components/operations.js.map +1 -1
- package/dist/config/configUtils.d.ts +1 -2
- package/dist/config/configUtils.js +7 -22
- package/dist/config/configUtils.js.map +1 -1
- package/dist/dataLayer/harperBridge/ResourceBridge.js +29 -2
- package/dist/dataLayer/harperBridge/ResourceBridge.js.map +1 -1
- package/dist/dataLayer/restoreMarker.d.ts +25 -3
- package/dist/dataLayer/restoreMarker.js +213 -13
- package/dist/dataLayer/restoreMarker.js.map +1 -1
- package/dist/dataLayer/schema.js +1 -4
- package/dist/dataLayer/schema.js.map +1 -1
- package/dist/dataLayer/schemaDescribe.js +10 -0
- package/dist/dataLayer/schemaDescribe.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/json/systemSchema.json +28 -0
- package/dist/resources/DatabaseTransaction.d.ts +21 -1
- package/dist/resources/DatabaseTransaction.js +147 -8
- package/dist/resources/DatabaseTransaction.js.map +1 -1
- package/dist/resources/PrimaryRocksDatabase.js +1 -1
- package/dist/resources/PrimaryRocksDatabase.js.map +1 -1
- package/dist/resources/Table.d.ts +31 -3
- package/dist/resources/Table.js +397 -79
- package/dist/resources/Table.js.map +1 -1
- package/dist/resources/auditStore.js +16 -10
- package/dist/resources/auditStore.js.map +1 -1
- package/dist/resources/blob.d.ts +1 -0
- package/dist/resources/blob.js +14 -5
- package/dist/resources/blob.js.map +1 -1
- package/dist/resources/branchDatabase.js +3 -3
- package/dist/resources/branchDatabase.js.map +1 -1
- package/dist/resources/databaseDropPreparation.d.ts +20 -0
- package/dist/resources/databaseDropPreparation.js +106 -0
- package/dist/resources/databaseDropPreparation.js.map +1 -0
- package/dist/resources/databases.d.ts +26 -21
- package/dist/resources/databases.js +1040 -204
- package/dist/resources/databases.js.map +1 -1
- package/dist/resources/derivedIndexRegistry.d.ts +23 -0
- package/dist/resources/derivedIndexRegistry.js +92 -0
- package/dist/resources/derivedIndexRegistry.js.map +1 -1
- package/dist/resources/derivedIndexRuntime.d.ts +10 -0
- package/dist/resources/derivedIndexRuntime.js +136 -25
- package/dist/resources/derivedIndexRuntime.js.map +1 -1
- package/dist/resources/derivedIndexes.d.ts +39 -0
- package/dist/resources/derivedIndexes.js +733 -0
- package/dist/resources/derivedIndexes.js.map +1 -0
- package/dist/resources/fullTextSchema.d.ts +8 -0
- package/dist/resources/fullTextSchema.js +42 -0
- package/dist/resources/fullTextSchema.js.map +1 -1
- package/dist/resources/fullTextSchemaLifecycle.d.ts +0 -5
- package/dist/resources/fullTextSchemaLifecycle.js +0 -9
- package/dist/resources/fullTextSchemaLifecycle.js.map +1 -1
- package/dist/resources/graphql.js +101 -9
- package/dist/resources/graphql.js.map +1 -1
- package/dist/resources/indexes/hnswDerivedIndex.d.ts +0 -10
- package/dist/resources/indexes/hnswDerivedIndex.js +0 -230
- package/dist/resources/indexes/hnswDerivedIndex.js.map +1 -1
- package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.d.ts +3 -0
- package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.js +57 -8
- package/dist/resources/indexes/nativeFullTextDerivedIndexLifecycle.js.map +1 -1
- package/dist/resources/models/Models.d.ts +26 -3
- package/dist/resources/models/Models.js +256 -13
- package/dist/resources/models/Models.js.map +1 -1
- package/dist/resources/models/TestBackend.d.ts +3 -1
- package/dist/resources/models/TestBackend.js +35 -1
- package/dist/resources/models/TestBackend.js.map +1 -1
- package/dist/resources/models/analyticsTable.d.ts +2 -2
- package/dist/resources/models/analyticsTable.js +4 -2
- package/dist/resources/models/analyticsTable.js.map +1 -1
- package/dist/resources/models/backendHelpers.d.ts +24 -0
- package/dist/resources/models/backendHelpers.js +18 -1
- package/dist/resources/models/backendHelpers.js.map +1 -1
- package/dist/resources/models/backendRegistry.d.ts +10 -21
- package/dist/resources/models/backendRegistry.js +74 -18
- package/dist/resources/models/backendRegistry.js.map +1 -1
- package/dist/resources/models/bootstrap.d.ts +7 -0
- package/dist/resources/models/bootstrap.js +36 -4
- package/dist/resources/models/bootstrap.js.map +1 -1
- package/dist/resources/models/decideHook.d.ts +33 -0
- package/dist/resources/models/decideHook.js +105 -0
- package/dist/resources/models/decideHook.js.map +1 -0
- package/dist/resources/models/decision.d.ts +64 -0
- package/dist/resources/models/decision.js +507 -0
- package/dist/resources/models/decision.js.map +1 -0
- package/dist/resources/models/decisionStore.d.ts +134 -0
- package/dist/resources/models/decisionStore.js +350 -0
- package/dist/resources/models/decisionStore.js.map +1 -0
- package/dist/resources/models/embedHook.d.ts +66 -8
- package/dist/resources/models/embedHook.js +228 -61
- package/dist/resources/models/embedHook.js.map +1 -1
- package/dist/resources/models/generativeDecision.d.ts +58 -0
- package/dist/resources/models/generativeDecision.js +315 -0
- package/dist/resources/models/generativeDecision.js.map +1 -0
- package/dist/resources/models/types.d.ts +232 -4
- package/dist/security/authn/oidc/tokenExchange.js +3 -33
- package/dist/security/authn/oidc/tokenExchange.js.map +1 -1
- package/dist/security/authn/oidc/tokenUseTable.d.ts +9 -0
- package/dist/security/authn/oidc/tokenUseTable.js +28 -0
- package/dist/security/authn/oidc/tokenUseTable.js.map +1 -0
- package/dist/security/certificateVerification/certificateVerificationSource.d.ts +0 -1
- package/dist/security/certificateVerification/certificateVerificationSource.js +3 -3
- package/dist/security/certificateVerification/certificateVerificationSource.js.map +1 -1
- package/dist/security/certificateVerification/crlVerification.js +77 -165
- package/dist/security/certificateVerification/crlVerification.js.map +1 -1
- package/dist/security/certificateVerification/types.d.ts +0 -3
- package/dist/security/certificateVerification/verificationTables.d.ts +19 -0
- package/dist/security/certificateVerification/verificationTables.js +125 -0
- package/dist/security/certificateVerification/verificationTables.js.map +1 -0
- package/dist/security/certificateVerification/verificationUtils.d.ts +1 -1
- package/dist/security/certificateVerification/verificationUtils.js +6 -31
- package/dist/security/certificateVerification/verificationUtils.js.map +1 -1
- package/dist/security/jsLoader.d.ts +5 -0
- package/dist/security/jsLoader.js +8 -0
- package/dist/security/jsLoader.js.map +1 -1
- package/dist/server/Server.d.ts +1 -0
- package/dist/server/Server.js.map +1 -1
- package/dist/server/http.js +2 -2
- package/dist/server/http.js.map +1 -1
- package/dist/server/itc/serverHandlers.js +21 -2
- package/dist/server/itc/serverHandlers.js.map +1 -1
- package/dist/server/jobs/jobOwnership.d.ts +25 -0
- package/dist/server/jobs/jobOwnership.js +127 -0
- package/dist/server/jobs/jobOwnership.js.map +1 -0
- package/dist/server/jobs/jobProcess.js +9 -2
- package/dist/server/jobs/jobProcess.js.map +1 -1
- package/dist/server/jobs/jobs.js +18 -5
- package/dist/server/jobs/jobs.js.map +1 -1
- package/dist/server/loadRootComponents.js +10 -0
- package/dist/server/loadRootComponents.js.map +1 -1
- package/dist/server/serverHelpers/contentTypes.js +11 -1
- package/dist/server/serverHelpers/contentTypes.js.map +1 -1
- package/dist/server/serverHelpers/serverHandlers.js +12 -2
- package/dist/server/serverHelpers/serverHandlers.js.map +1 -1
- package/dist/server/threads/itc.d.ts +4 -1
- package/dist/server/threads/itc.js +29 -6
- package/dist/server/threads/itc.js.map +1 -1
- package/dist/server/threads/manageThreads.d.ts +12 -4
- package/dist/server/threads/manageThreads.js +241 -119
- package/dist/server/threads/manageThreads.js.map +1 -1
- package/dist/server/threads/threadServer.d.ts +1 -0
- package/dist/server/threads/threadServer.js +15 -1
- package/dist/server/threads/threadServer.js.map +1 -1
- package/dist/server/threads/windowsProcessTree.d.ts +91 -0
- package/dist/server/threads/windowsProcessTree.js +361 -0
- package/dist/server/threads/windowsProcessTree.js.map +1 -0
- package/dist/server/throttle.d.ts +1 -1
- package/dist/server/throttle.js +8 -1
- package/dist/server/throttle.js.map +1 -1
- package/dist/upgrade/directives/5-3-0.js +53 -46
- package/dist/upgrade/directives/5-3-0.js.map +1 -1
- package/dist/utility/errors/hdbError.d.ts +10 -1
- package/dist/utility/errors/hdbError.js +55 -11
- package/dist/utility/errors/hdbError.js.map +1 -1
- package/dist/utility/fsync.d.ts +2 -0
- package/dist/utility/fsync.js +20 -0
- package/dist/utility/fsync.js.map +1 -0
- package/dist/utility/globalSchema.d.ts +18 -0
- package/dist/utility/hdbTerms.d.ts +3 -0
- package/dist/utility/hdbTerms.js +3 -0
- package/dist/utility/hdbTerms.js.map +1 -1
- package/dist/utility/signalling.d.ts +7 -1
- package/dist/utility/signalling.js +27 -3
- package/dist/utility/signalling.js.map +1 -1
- package/dist/utility/when.d.ts +1 -0
- package/dist/utility/when.js +21 -0
- package/dist/utility/when.js.map +1 -1
- package/dist/validation/configValidator.js +30 -3
- package/dist/validation/configValidator.js.map +1 -1
- package/index.ts +13 -0
- package/json/systemSchema.json +28 -0
- package/npm-shrinkwrap.json +151 -55
- package/package.json +14 -13
- package/resources/DESIGN.md +80 -100
- package/resources/DatabaseTransaction.ts +157 -10
- package/resources/PrimaryRocksDatabase.ts +2 -2
- package/resources/Table.ts +494 -101
- package/resources/auditStore.ts +18 -10
- package/resources/blob.ts +13 -6
- package/resources/branchDatabase.ts +3 -3
- package/resources/databaseDropPreparation.ts +120 -0
- package/resources/databases.ts +1155 -205
- package/resources/derivedIndexRegistry.ts +122 -0
- package/resources/derivedIndexRuntime.ts +157 -30
- package/resources/derivedIndexes.ts +856 -0
- package/resources/fullTextSchema.ts +55 -0
- package/resources/fullTextSchemaLifecycle.ts +0 -15
- package/resources/graphql.ts +107 -12
- package/resources/indexes/DESIGN.md +7 -0
- package/resources/indexes/hnswDerivedIndex.ts +0 -260
- package/resources/indexes/nativeFullTextDerivedIndexLifecycle.ts +72 -9
- package/resources/models/DESIGN.md +39 -0
- package/resources/models/Models.ts +361 -18
- package/resources/models/TestBackend.ts +56 -1
- package/resources/models/analyticsTable.ts +6 -4
- package/resources/models/backendHelpers.ts +17 -0
- package/resources/models/backendRegistry.ts +76 -21
- package/resources/models/bootstrap.ts +57 -7
- package/resources/models/decideHook.ts +135 -0
- package/resources/models/decision.ts +505 -0
- package/resources/models/decisionStore.ts +419 -0
- package/resources/models/embedHook.ts +272 -55
- package/resources/models/generativeDecision.ts +459 -0
- package/resources/models/types.ts +231 -4
- package/security/DESIGN.md +22 -2
- package/security/authn/oidc/tokenExchange.ts +6 -34
- package/security/authn/oidc/tokenUseTable.ts +27 -0
- package/security/certificateVerification/certificateVerificationSource.ts +2 -3
- package/security/certificateVerification/crlVerification.ts +96 -174
- package/security/certificateVerification/types.ts +0 -3
- package/security/certificateVerification/verificationTables.ts +124 -0
- package/security/certificateVerification/verificationUtils.ts +8 -32
- package/security/jsLoader.ts +9 -1
- package/server/DESIGN.md +27 -1
- package/server/Server.ts +2 -1
- package/server/http.ts +4 -2
- package/server/itc/serverHandlers.js +29 -1
- package/server/jobs/jobOwnership.ts +89 -0
- package/server/jobs/jobProcess.ts +8 -2
- package/server/jobs/jobs.ts +15 -4
- package/server/loadRootComponents.js +11 -0
- package/server/serverHelpers/contentTypes.ts +13 -1
- package/server/serverHelpers/serverHandlers.js +11 -2
- package/server/threads/itc.js +32 -6
- package/server/threads/manageThreads.js +268 -122
- package/server/threads/threadServer.js +13 -1
- package/server/threads/windowsProcessTree.ts +409 -0
- package/server/throttle.ts +11 -1
- package/studio/web/assets/{Chat-CveGbxe6.js → Chat-Bq60AO-g.js} +1 -1
- package/studio/web/assets/{FloatingChat-IpCFgYWL.js → FloatingChat-D4560T0p.js} +3 -3
- package/studio/web/assets/{apiToken-CS8fFTgL.js → apiToken-BEvbFPMc.js} +1 -1
- package/studio/web/assets/{applications-D7F4Jopl.js → applications-CSUVTH4E.js} +1 -1
- package/studio/web/assets/{cssMode-Daw_oLPq.js → cssMode-DJyc9mHj.js} +1 -1
- package/studio/web/assets/{editor-B3Bs1zWX.js → editor-DDIsQfj6.js} +1 -1
- package/studio/web/assets/{html-CDaQwWiE.js → html-g1BJHxLy.js} +1 -1
- package/studio/web/assets/{htmlMode-Cb6emO4U.js → htmlMode-Vh5IglCQ.js} +1 -1
- package/studio/web/assets/{index-B4g2Fu_2.js → index-DGRAzvO4.js} +5 -5
- package/studio/web/assets/{index.lazy-NwhvF1q1.js → index.lazy-vgSic7et.js} +1 -1
- package/studio/web/assets/{javascript-2_86gB9Q.js → javascript-5VIolqf7.js} +1 -1
- package/studio/web/assets/{jsonMode-DX-i86uQ.js → jsonMode-DG4zQraI.js} +1 -1
- package/studio/web/assets/{languageServices-B85WN-Ej.js → languageServices-t5FBpX-i.js} +1 -1
- package/studio/web/assets/{lspLanguageFeatures-JCWHIsKg.js → lspLanguageFeatures-DgVnNPh-.js} +1 -1
- package/studio/web/assets/{notifications-D9ejzt52.js → notifications-BeWcX04m.js} +1 -1
- package/studio/web/assets/{notifications-B7hjKhai.js → notifications-DUGWrWoO.js} +1 -1
- package/studio/web/assets/{profile-D8B6No3F.js → profile-BvUEDBzW.js} +1 -1
- package/studio/web/assets/{regions-DFazIfTK.js → regions-CB-_2m7M.js} +1 -1
- package/studio/web/assets/{register-CwFLviLF.js → register-1w1Zr3b2.js} +2 -2
- package/studio/web/assets/{setComponentFile-VnJ80SSJ.js → setComponentFile-z4-qJCbA.js} +1 -1
- package/studio/web/assets/{setup-BYQxFy-C.js → setup-CS50uJ4x.js} +2 -2
- package/studio/web/assets/{status-Cn5XjmsL.js → status-CI0wOdOE.js} +1 -1
- package/studio/web/assets/{toggleHighContrast-g9xIh6TX.js → toggleHighContrast-BsAE4jPe.js} +1 -1
- package/studio/web/assets/{tsMode-EC-n0Wqc.js → tsMode-D83Gg3cq.js} +1 -1
- package/studio/web/assets/{typescript-DHmM9JCO.js → typescript-Dfp-GrNq.js} +1 -1
- package/studio/web/assets/{useEntityRestURL-BUdnVSVv.js → useEntityRestURL-BKetlINf.js} +1 -1
- package/studio/web/assets/{workers-BVl9bBB-.js → workers-CCvmDLH3.js} +1 -1
- package/studio/web/assets/{xml-C4_sqOkX.js → xml-06pZp00U.js} +1 -1
- package/studio/web/assets/{yaml-CVkbDqtW.js → yaml-iSnWMVlV.js} +1 -1
- package/studio/web/index.html +1 -1
- package/upgrade/directives/5-3-0.ts +61 -54
- package/utility/DESIGN.md +5 -1
- package/utility/errors/hdbError.ts +56 -8
- package/utility/fsync.ts +16 -0
- package/utility/hdbTerms.ts +3 -0
- package/utility/signalling.ts +33 -4
- package/utility/when.ts +22 -0
- package/validation/configValidator.ts +36 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,c as t,d as n,g as r,h as i,l as a,r as o}from"./register-
|
|
1
|
+
import{_ as e,c as t,d as n,g as r,h as i,l as a,r as o}from"./register-1w1Zr3b2.js";import{t as s}from"./workers-CCvmDLH3.js";var c=class{constructor(e,t){this._modeId=e,this._defaults=t,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}async _updateExtraLibs(){if(!this._worker)return;let e=++this._updateExtraLibsToken,t=await this._worker.getProxy();this._updateExtraLibsToken===e&&t.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){return this._client||=(async()=>(this._worker=s({moduleId:`vs/language/typescript/tsWorker`,createWorker:()=>new Worker(new URL(`/assets/ts.worker-DDMUrpqh.js`,``+import.meta.url),{type:`module`}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync()?await this._worker.withSyncedResources(r.getModels().filter(e=>e.getLanguageId()===this._modeId).map(e=>e.uri)):await this._worker.getProxy()))(),this._client}async getLanguageServiceWorker(...e){let t=await this._getClient();return this._worker&&await this._worker.withSyncedResources(e),t}},l={};l[`lib.d.ts`]=!0,l[`lib.decorators.d.ts`]=!0,l[`lib.decorators.legacy.d.ts`]=!0,l[`lib.dom.asynciterable.d.ts`]=!0,l[`lib.dom.d.ts`]=!0,l[`lib.dom.iterable.d.ts`]=!0,l[`lib.es2015.collection.d.ts`]=!0,l[`lib.es2015.core.d.ts`]=!0,l[`lib.es2015.d.ts`]=!0,l[`lib.es2015.generator.d.ts`]=!0,l[`lib.es2015.iterable.d.ts`]=!0,l[`lib.es2015.promise.d.ts`]=!0,l[`lib.es2015.proxy.d.ts`]=!0,l[`lib.es2015.reflect.d.ts`]=!0,l[`lib.es2015.symbol.d.ts`]=!0,l[`lib.es2015.symbol.wellknown.d.ts`]=!0,l[`lib.es2016.array.include.d.ts`]=!0,l[`lib.es2016.d.ts`]=!0,l[`lib.es2016.full.d.ts`]=!0,l[`lib.es2016.intl.d.ts`]=!0,l[`lib.es2017.arraybuffer.d.ts`]=!0,l[`lib.es2017.d.ts`]=!0,l[`lib.es2017.date.d.ts`]=!0,l[`lib.es2017.full.d.ts`]=!0,l[`lib.es2017.intl.d.ts`]=!0,l[`lib.es2017.object.d.ts`]=!0,l[`lib.es2017.sharedmemory.d.ts`]=!0,l[`lib.es2017.string.d.ts`]=!0,l[`lib.es2017.typedarrays.d.ts`]=!0,l[`lib.es2018.asyncgenerator.d.ts`]=!0,l[`lib.es2018.asynciterable.d.ts`]=!0,l[`lib.es2018.d.ts`]=!0,l[`lib.es2018.full.d.ts`]=!0,l[`lib.es2018.intl.d.ts`]=!0,l[`lib.es2018.promise.d.ts`]=!0,l[`lib.es2018.regexp.d.ts`]=!0,l[`lib.es2019.array.d.ts`]=!0,l[`lib.es2019.d.ts`]=!0,l[`lib.es2019.full.d.ts`]=!0,l[`lib.es2019.intl.d.ts`]=!0,l[`lib.es2019.object.d.ts`]=!0,l[`lib.es2019.string.d.ts`]=!0,l[`lib.es2019.symbol.d.ts`]=!0,l[`lib.es2020.bigint.d.ts`]=!0,l[`lib.es2020.d.ts`]=!0,l[`lib.es2020.date.d.ts`]=!0,l[`lib.es2020.full.d.ts`]=!0,l[`lib.es2020.intl.d.ts`]=!0,l[`lib.es2020.number.d.ts`]=!0,l[`lib.es2020.promise.d.ts`]=!0,l[`lib.es2020.sharedmemory.d.ts`]=!0,l[`lib.es2020.string.d.ts`]=!0,l[`lib.es2020.symbol.wellknown.d.ts`]=!0,l[`lib.es2021.d.ts`]=!0,l[`lib.es2021.full.d.ts`]=!0,l[`lib.es2021.intl.d.ts`]=!0,l[`lib.es2021.promise.d.ts`]=!0,l[`lib.es2021.string.d.ts`]=!0,l[`lib.es2021.weakref.d.ts`]=!0,l[`lib.es2022.array.d.ts`]=!0,l[`lib.es2022.d.ts`]=!0,l[`lib.es2022.error.d.ts`]=!0,l[`lib.es2022.full.d.ts`]=!0,l[`lib.es2022.intl.d.ts`]=!0,l[`lib.es2022.object.d.ts`]=!0,l[`lib.es2022.regexp.d.ts`]=!0,l[`lib.es2022.string.d.ts`]=!0,l[`lib.es2023.array.d.ts`]=!0,l[`lib.es2023.collection.d.ts`]=!0,l[`lib.es2023.d.ts`]=!0,l[`lib.es2023.full.d.ts`]=!0,l[`lib.es2023.intl.d.ts`]=!0,l[`lib.es2024.arraybuffer.d.ts`]=!0,l[`lib.es2024.collection.d.ts`]=!0,l[`lib.es2024.d.ts`]=!0,l[`lib.es2024.full.d.ts`]=!0,l[`lib.es2024.object.d.ts`]=!0,l[`lib.es2024.promise.d.ts`]=!0,l[`lib.es2024.regexp.d.ts`]=!0,l[`lib.es2024.sharedmemory.d.ts`]=!0,l[`lib.es2024.string.d.ts`]=!0,l[`lib.es5.d.ts`]=!0,l[`lib.es6.d.ts`]=!0,l[`lib.esnext.array.d.ts`]=!0,l[`lib.esnext.collection.d.ts`]=!0,l[`lib.esnext.d.ts`]=!0,l[`lib.esnext.decorators.d.ts`]=!0,l[`lib.esnext.disposable.d.ts`]=!0,l[`lib.esnext.error.d.ts`]=!0,l[`lib.esnext.float16.d.ts`]=!0,l[`lib.esnext.full.d.ts`]=!0,l[`lib.esnext.intl.d.ts`]=!0,l[`lib.esnext.iterator.d.ts`]=!0,l[`lib.esnext.promise.d.ts`]=!0,l[`lib.esnext.sharedmemory.d.ts`]=!0,l[`lib.scripthost.d.ts`]=!0,l[`lib.webworker.asynciterable.d.ts`]=!0,l[`lib.webworker.d.ts`]=!0,l[`lib.webworker.importscripts.d.ts`]=!0,l[`lib.webworker.iterable.d.ts`]=!0;function u(e,t,n=0){if(typeof e==`string`)return e;if(e===void 0)return``;let r=``;if(n){r+=t;for(let e=0;e<n;e++)r+=` `}if(r+=e.messageText,n++,e.next)for(let i of e.next)r+=u(i,t,n);return r}function d(e){return e?e.map(e=>e.text).join(``):``}var f=class{constructor(e){this._worker=e}_textSpanToRange(e,t){let n=e.getPositionAt(t.start),r=e.getPositionAt(t.start+t.length),{lineNumber:i,column:a}=n,{lineNumber:o,column:s}=r;return{startLineNumber:i,startColumn:a,endLineNumber:o,endColumn:s}}},p=class{constructor(e){this._worker=e,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(e){return e?e.path.indexOf(`/lib.`)===0&&!!l[e.path.slice(1)]:!1}getOrCreateModel(e){let t=i.parse(e),n=r.getModel(t);if(n)return n;if(this.isLibFile(t)&&this._hasFetchedLibFiles)return r.createModel(this._libFiles[t.path.slice(1)],`typescript`,t);let a=o.getExtraLibs()[e];return a?r.createModel(a.content,`typescript`,t):null}_containsLibFile(e){for(let t of e)if(this.isLibFile(t))return!0;return!1}async fetchLibFilesIfNecessary(e){this._containsLibFile(e)&&await this._fetchLibFiles()}_fetchLibFiles(){return this._fetchLibFilesPromise||=this._worker().then(e=>e.getLibFiles()).then(e=>{this._hasFetchedLibFiles=!0,this._libFiles=e}),this._fetchLibFilesPromise}},m=class extends f{constructor(e,t,n,i){super(i),this._libFiles=e,this._defaults=t,this._selector=n,this._disposables=[],this._listener=Object.create(null);let a=e=>{if(e.getLanguageId()!==n)return;let t=()=>{let{onlyVisible:t}=this._defaults.getDiagnosticsOptions();t?e.isAttachedToEditor()&&this._doValidate(e):this._doValidate(e)},i,a=e.onDidChangeContent(()=>{clearTimeout(i),i=window.setTimeout(t,500)}),o=e.onDidChangeAttached(()=>{let{onlyVisible:n}=this._defaults.getDiagnosticsOptions();n&&(e.isAttachedToEditor()?t():r.setModelMarkers(e,this._selector,[]))});this._listener[e.uri.toString()]={dispose(){a.dispose(),o.dispose(),clearTimeout(i)}},t()},o=e=>{r.setModelMarkers(e,this._selector,[]);let t=e.uri.toString();this._listener[t]&&(this._listener[t].dispose(),delete this._listener[t])};this._disposables.push(r.onDidCreateModel(e=>a(e))),this._disposables.push(r.onWillDisposeModel(o)),this._disposables.push(r.onDidChangeModelLanguage(e=>{o(e.model),a(e.model)})),this._disposables.push({dispose(){for(let e of r.getModels())o(e)}});let s=()=>{for(let e of r.getModels())o(e),a(e)};this._disposables.push(this._defaults.onDidChange(s)),this._disposables.push(this._defaults.onDidExtraLibsChange(s)),r.getModels().forEach(e=>a(e))}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables=[]}async _doValidate(e){let t=await this._worker(e.uri);if(e.isDisposed())return;let n=[],{noSyntaxValidation:a,noSemanticValidation:o,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();a||n.push(t.getSyntacticDiagnostics(e.uri.toString())),o||n.push(t.getSemanticDiagnostics(e.uri.toString())),s||n.push(t.getSuggestionDiagnostics(e.uri.toString()));let c=await Promise.all(n);if(!c||e.isDisposed())return;let l=c.reduce((e,t)=>t.concat(e),[]).filter(e=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(e.code)===-1),u=l.map(e=>e.relatedInformation||[]).reduce((e,t)=>t.concat(e),[]).map(e=>e.file?i.parse(e.file.fileName):null);await this._libFiles.fetchLibFilesIfNecessary(u),!e.isDisposed()&&r.setModelMarkers(e,this._selector,l.map(t=>this._convertDiagnostics(e,t)))}_convertDiagnostics(e,t){let n=t.start||0,r=t.length||1,{lineNumber:i,column:o}=e.getPositionAt(n),{lineNumber:s,column:c}=e.getPositionAt(n+r),l=[];return t.reportsUnnecessary&&l.push(a.Unnecessary),t.reportsDeprecated&&l.push(a.Deprecated),{severity:this._tsDiagnosticCategoryToMarkerSeverity(t.category),startLineNumber:i,startColumn:o,endLineNumber:s,endColumn:c,message:u(t.messageText,`
|
|
2
2
|
`),code:t.code.toString(),tags:l,relatedInformation:this._convertRelatedInformation(e,t.relatedInformation)}}_convertRelatedInformation(e,t){if(!t)return[];let n=[];return t.forEach(t=>{let r=e;if(t.file&&(r=this._libFiles.getOrCreateModel(t.file.fileName)),!r)return;let i=t.start||0,a=t.length||1,{lineNumber:o,column:s}=r.getPositionAt(i),{lineNumber:c,column:l}=r.getPositionAt(i+a);n.push({resource:r.uri,startLineNumber:o,startColumn:s,endLineNumber:c,endColumn:l,message:u(t.messageText,`
|
|
3
3
|
`)})}),n}_tsDiagnosticCategoryToMarkerSeverity(e){switch(e){case 1:return t.Error;case 3:return t.Info;case 0:return t.Warning;case 2:return t.Hint}return t.Info}},h=class t extends f{get triggerCharacters(){return[`.`]}async provideCompletionItems(r,i,a,o){let s=r.getWordUntilPosition(i),c=new n(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn),l=r.uri,u=r.getOffsetAt(i),d=await this._worker(l);if(r.isDisposed())return;let f=await d.getCompletionsAtPosition(l.toString(),u);if(f&&!r.isDisposed())return{suggestions:f.entries.map(a=>{let o=c;if(a.replacementSpan){let e=r.getPositionAt(a.replacementSpan.start),t=r.getPositionAt(a.replacementSpan.start+a.replacementSpan.length);o=new n(e.lineNumber,e.column,t.lineNumber,t.column)}let s=[];return a.kindModifiers!==void 0&&a.kindModifiers.indexOf(`deprecated`)!==-1&&s.push(e.CompletionItemTag.Deprecated),{uri:l,position:i,offset:u,range:o,label:a.name,insertText:a.name,sortText:a.sortText,kind:t.convertKind(a.kind),tags:s}})}}async resolveCompletionItem(e,n){let r=e,i=r.uri,a=r.position,o=r.offset,s=await(await this._worker(i)).getCompletionEntryDetails(i.toString(),o,r.label);return s?{uri:i,position:a,label:s.name,kind:t.convertKind(s.kind),detail:d(s.displayParts),documentation:{value:t.createDocumentationString(s)}}:r}static convertKind(t){switch(t){case C.primitiveType:case C.keyword:return e.CompletionItemKind.Keyword;case C.variable:case C.localVariable:return e.CompletionItemKind.Variable;case C.memberVariable:case C.memberGetAccessor:case C.memberSetAccessor:return e.CompletionItemKind.Field;case C.function:case C.memberFunction:case C.constructSignature:case C.callSignature:case C.indexSignature:return e.CompletionItemKind.Function;case C.enum:return e.CompletionItemKind.Enum;case C.module:return e.CompletionItemKind.Module;case C.class:return e.CompletionItemKind.Class;case C.interface:return e.CompletionItemKind.Interface;case C.warning:return e.CompletionItemKind.File}return e.CompletionItemKind.Property}static createDocumentationString(e){let t=d(e.documentation);if(e.tags)for(let n of e.tags)t+=`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./register-
|
|
1
|
+
import{_ as e}from"./register-1w1Zr3b2.js";var t={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:`//`,blockComment:[`/*`,`*/`]},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:e.IndentAction.IndentOutdent,appendText:` * `}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:e.IndentAction.None,appendText:` * `}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:e.IndentAction.None,appendText:`* `}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:e.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`,`comment`]},{open:"`",close:"`",notIn:[`string`,`comment`]},{open:`/**`,close:` */`,notIn:[`string`]}],folding:{markers:{start:RegExp(`^\\s*//\\s*#?region\\b`),end:RegExp(`^\\s*//\\s*#?endregion\\b`)}}},n={defaultToken:`invalid`,tokenPostfix:`.ts`,keywords:`abstract.any.as.asserts.bigint.boolean.break.case.catch.class.continue.const.constructor.debugger.declare.default.delete.do.else.enum.export.extends.false.finally.for.from.function.get.if.implements.import.in.infer.instanceof.interface.is.keyof.let.module.namespace.never.new.null.number.object.out.package.private.protected.public.override.readonly.require.global.return.satisfies.set.static.string.super.switch.symbol.this.throw.true.try.type.typeof.undefined.unique.unknown.var.void.while.with.yield.async.await.of`.split(`.`),operators:`<=.>=.==.!=.===.!==.=>.+.-.**.*./.%.++.--.<<.</.>>.>>>.&.|.^.!.~.&&.||.??.?.:.=.+=.-=.*=.**=./=.%=.<<=.>>=.>>>=.&=.|=.^=.@`.split(`.`),symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:{root:[[/[{}]/,`delimiter.bracket`],{include:`common`}],common:[[/#?[a-z_$][\w$]*/,{cases:{"@keywords":`keyword`,"@default":`identifier`}}],[/[A-Z][\w\$]*/,`type.identifier`],{include:`@whitespace`},[/\/(?=([^\\\/]|\\.)+\/([dgimsuy]*)(\s*)(\.|;|,|\)|\]|\}|$))/,{token:`regexp`,bracket:`@open`,next:`@regexp`}],[/[()\[\]]/,`@brackets`],[/[<>](?!@symbols)/,`@brackets`],[/!(?=([^=]|$))/,`delimiter`],[/@symbols/,{cases:{"@operators":`delimiter`,"@default":``}}],[/(@digits)[eE]([\-+]?(@digits))?/,`number.float`],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,`number.float`],[/0[xX](@hexdigits)n?/,`number.hex`],[/0[oO]?(@octaldigits)n?/,`number.octal`],[/0[bB](@binarydigits)n?/,`number.binary`],[/(@digits)n?/,`number`],[/[;,.]/,`delimiter`],[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/"/,`string`,`@string_double`],[/'/,`string`,`@string_single`],[/`/,`string`,`@string_backtick`]],whitespace:[[/[ \t\r\n]+/,``],[/\/\*\*(?!\/)/,`comment.doc`,`@jsdoc`],[/\/\*/,`comment`,`@comment`],[/\/\/.*$/,`comment`]],comment:[[/[^\/*]+/,`comment`],[/\*\//,`comment`,`@pop`],[/[\/*]/,`comment`]],jsdoc:[[/[^\/*]+/,`comment.doc`],[/\*\//,`comment.doc`,`@pop`],[/[\/*]/,`comment.doc`]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,[`regexp.escape.control`,`regexp.escape.control`,`regexp.escape.control`]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,[`regexp.escape.control`,{token:`regexp.escape.control`,next:`@regexrange`}]],[/(\()(\?:|\?=|\?!)/,[`regexp.escape.control`,`regexp.escape.control`]],[/[()]/,`regexp.escape.control`],[/@regexpctl/,`regexp.escape.control`],[/[^\\\/]/,`regexp`],[/@regexpesc/,`regexp.escape`],[/\\\./,`regexp.invalid`],[/(\/)([dgimsuy]*)/,[{token:`regexp`,bracket:`@close`,next:`@pop`},`keyword.other`]]],regexrange:[[/-/,`regexp.escape.control`],[/\^/,`regexp.invalid`],[/@regexpesc/,`regexp.escape`],[/[^\]]/,`regexp`],[/\]/,{token:`regexp.escape.control`,next:`@pop`,bracket:`@close`}]],string_double:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],string_single:[[/[^\\']+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/'/,`string`,`@pop`]],string_backtick:[[/\$\{/,{token:`delimiter.bracket`,next:`@bracketCounting`}],[/[^\\`$]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/`/,`string`,`@pop`]],bracketCounting:[[/\{/,`delimiter.bracket`,`@bracketCounting`],[/\}/,`delimiter.bracket`,`@pop`],{include:`common`}]}};export{t as conf,n as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./authStore-5jSS5pTW.js";import{k as t,z as n}from"./vendor-tanstack-CQ1aRjVa.js";import{jn as r,vn as i}from"./index-
|
|
1
|
+
import{n as e}from"./authStore-5jSS5pTW.js";import{k as t,z as n}from"./vendor-tanstack-CQ1aRjVa.js";import{jn as r,vn as i}from"./index-DGRAzvO4.js";function a(e){return new URL(e.match(/^https?:\/\//i)?e:`https://${e}`).toString()}function o(e){if(e?.domains){for(let t of e.domains)if(t.domain)return a(t.domain)}return e?.fqdn?a(e.fqdn):null}function s(){let{clusterId:a,instanceId:s}=t({strict:!1}),c=r(),{data:l}=n(i(a));return a&&e.checkForFabricConnect(a)||s&&e.checkForFabricConnect(s)||l&&!s?o(l):c.defaults.baseURL?c.defaults.baseURL.replace(/:9925\/?/,``):null}export{s as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{At as e,Bl as t,Cn as n,Hs as r,Hu as i,Is as a,Nd as o,Pd as s,Qu as c,So as l,Uu as u,ai as d,bn as f,bs as p,dd as m,ds as h,fc as g,ft as _,g as v,gs as y,kt as b,md as ee,ms as x,nc as S,nf as C,pd as w,tf as T,ti as E,vd as D,xn as O,xs as k,ys as A}from"./register-
|
|
1
|
+
import{At as e,Bl as t,Cn as n,Hs as r,Hu as i,Is as a,Nd as o,Pd as s,Qu as c,So as l,Uu as u,ai as d,bn as f,bs as p,dd as m,ds as h,fc as g,ft as _,g as v,gs as y,kt as b,md as ee,ms as x,nc as S,nf as C,pd as w,tf as T,ti as E,vd as D,xn as O,xs as k,ys as A}from"./register-1w1Zr3b2.js";import{a as j,c as M,d as te,f as ne,i as N,l as P,n as F,o as I,p as L,r as R,u as z}from"./toggleHighContrast-BsAE4jPe.js";var B=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;let n=this._selection.startLineNumber,r=this._selection.startColumn,i=this._selection.endColumn;if(!(this._isMovingLeft&&r===1)&&(this._isMovingLeft||i!==e.getLineMaxColumn(n))){if(this._isMovingLeft){let a=new u(n,r-1,n,r),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new u(n,i,n,i),o)}else{let a=new u(n,i,n,i+1),o=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new u(n,r,n,r),o)}}}computeCursorState(e,t){return this._isMovingLeft?new i(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new i(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}},V=class extends x{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let n=[],r=t.getSelections();for(let e of r)n.push(new B(e,this.left));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},H=class extends V{constructor(){super(!0,{id:`editor.action.moveCarretLeftAction`,label:s(846,`Move Selected Text Left`),precondition:d.writable})}},U=class extends V{constructor(){super(!1,{id:`editor.action.moveCarretRightAction`,label:s(847,`Move Selected Text Right`),precondition:d.writable})}};A(H),A(U);var W=`editor.action.pasteAs`;k(M.ID,M,0),_(te),p(new class extends y{constructor(){super({id:P,precondition:z,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t){return M.get(t)?.changePasteType()}}),p(new class extends y{constructor(){super({id:`editor.hidePasteWidget`,precondition:z,kbOpts:{weight:100,primary:9}})}runEditorCommand(e,t){M.get(t)?.clearWidgets()}}),A(class e extends x{static{this.argsSchema={oneOf:[{type:`object`,required:[`kind`],properties:{kind:{type:`string`,description:o(952,`The kind of the paste edit to try pasting with.
|
|
2
2
|
If there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.`)}}},{type:`object`,required:[`preferences`],properties:{preferences:{type:`array`,description:o(953,`List of preferred paste edit kind to try applying.
|
|
3
3
|
The first edit matching the preferences will be applied.`),items:{type:`string`}}}}]}}constructor(){super({id:W,label:s(954,`Paste As...`),precondition:d.writable,metadata:{description:`Paste as`,args:[{name:`args`,schema:e.argsSchema}]},canTriggerInlineEdits:!0})}run(e,t,n){let r;return n&&(`kind`in n?r={only:new L(n.kind)}:`preferences`in n&&(r={preferences:n.preferences.map(e=>new L(e))})),M.get(t)?.pasteAs(r)}}),A(class extends x{constructor(){super({id:`editor.action.pasteAsText`,label:s(955,`Paste as Text`),precondition:d.writable,canTriggerInlineEdits:!0})}run(e,t){return M.get(t)?.pasteAs({providerId:ne.id})}});var G=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},K=function(e,t){return function(n,r){t(n,r,e)}},q=class extends w{static{this.ID=`editor.contrib.markerSelectionStatus`}constructor(e,t,n){super(),this._editor=e,this._markerService=n,this._ctxHasDiagnostics=d.selectionHasDiagnostics.bindTo(t),this._store.add(this._editor.onDidChangeCursorSelection(()=>this._update())),this._store.add(this._editor.onDidChangeModel(()=>this._update())),this._store.add(this._markerService.onMarkerChanged(e=>{let t=this._editor.getModel();t&&e.some(e=>a(e,t.uri))&&this._update()})),this._update()}dispose(){this._ctxHasDiagnostics.reset(),super.dispose()}_update(){let t=this._editor.getModel(),n=this._editor.getSelection();if(!t||!n){this._ctxHasDiagnostics.reset();return}let r=this._markerService.read({resource:t.uri,severities:e.Error|e.Warning|e.Info}).some(e=>u.areIntersecting({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn},n));this._ctxHasDiagnostics.set(r)}};q=G([K(1,S),K(2,b)],q),k(q.ID,q,1);var J=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Y=function(e,t){return function(n,r){t(n,r,e)}},X,Z=class extends w{constructor(e,t,n,i,a,o){super(),this._watchers=new r,this._providerChangeListeners=this._register(new ee);let s=o.documentSemanticTokensProvider,c=t=>{this._watchers.get(t.uri)?.dispose(),this._watchers.set(t.uri,new Q(t,e,n,a,o))},l=(e,t)=>{t.dispose(),this._watchers.delete(e.uri)},u=()=>{for(let e of t.getModels()){let t=this._watchers.get(e.uri);F(e,n,i)?t||c(e):t&&l(e,t)}},d=()=>{this._providerChangeListeners.clear();for(let e of s.allNoModel())typeof e.onDidChange==`function`&&this._providerChangeListeners.add(e.onDidChange(()=>{for(let t of this._watchers.values())t.handleProviderDidChange(e)}))};t.getModels().forEach(e=>{F(e,n,i)&&c(e)}),this._register(t.onModelAdded(e=>{F(e,n,i)&&c(e)})),this._register(t.onModelRemoved(e=>{let t=this._watchers.get(e.uri);t&&l(e,t)})),this._register(i.onDidChangeConfiguration(e=>{e.affectsConfiguration(`editor.semanticHighlighting`)&&u()})),this._register(n.onDidColorThemeChange(u)),d(),this._register(s.onDidChange(()=>{d();for(let e of this._watchers.values())e.handleRegistryChange()}))}dispose(){D(this._watchers.values()),this._watchers.clear(),super.dispose()}};Z=J([Y(0,f),Y(1,g),Y(2,E),Y(3,h),Y(4,n),Y(5,l)],Z);var Q=class extends w{static{X=this}static{this.REQUEST_MIN_DELAY=300}static{this.REQUEST_MAX_DELAY=2e3}constructor(e,n,r,i,a){super(),this._semanticTokensStylingService=n,this._relevantProviders=new Set,this._isDisposed=!1,this._model=e,this._provider=a.documentSemanticTokensProvider,this._debounceInformation=i.for(this._provider,`DocumentSemanticTokens`,{min:X.REQUEST_MIN_DELAY,max:X.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new t(()=>this._fetchDocumentSemanticTokensNow(),X.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._providersChangedDuringRequest=!1,this._updateRelevantProviders(),this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&=(this._currentDocumentResponse.dispose(),null),this._currentDocumentRequestCancellationTokenSource&&=(this._currentDocumentRequestCancellationTokenSource.cancel(),null),this._setDocumentSemanticTokens(null,null,null,[]),this._updateRelevantProviders(),this._fetchDocumentSemanticTokens.schedule(0)})),this._register(r.onDidColorThemeChange(e=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}handleRegistryChange(){this._updateRelevantProviders(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}handleProviderDidChange(e){if(this._relevantProviders.has(e)){if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}}_updateRelevantProviders(){this._relevantProviders=new Set(this._provider.all(this._model))}dispose(){this._currentDocumentResponse&&=(this._currentDocumentResponse.dispose(),null),this._currentDocumentRequestCancellationTokenSource&&=(this._currentDocumentRequestCancellationTokenSource.cancel(),null),this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!N(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;let e=new c,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,n=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=R(this._provider,this._model,t,n,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;let i=[],a=this._model.onDidChangeContent(e=>{i.push(e)}),o=new m(!1);r.then(e=>{if(this._debounceInformation.update(this._model,o.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),!e)this._setDocumentSemanticTokens(null,null,null,i);else{let{provider:t,tokens:n}=e,r=this._semanticTokensStylingService.getStyling(t);this._setDocumentSemanticTokens(t,n||null,r,i)}},e=>{e&&(T(e)||typeof e.message==`string`&&e.message.indexOf(`busy`)!==-1)||C(e),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),(i.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,n,r,i){i=Math.min(i,n.length-r,e.length-t);for(let a=0;a<i;a++)n[r+a]=e[t+a]}_setDocumentSemanticTokens(e,t,n,r){let i=this._currentDocumentResponse,a=()=>{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&=(this._currentDocumentResponse.dispose(),null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!n){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),a();return}if(I(t)){if(!i){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:i.data};else{let e=0;for(let n of t.edits)e+=(n.data?n.data.length:0)-n.deleteCount;let r=i.data,a=new Uint32Array(r.length+e),o=r.length,s=a.length;for(let e=t.edits.length-1;e>=0;e--){let c=t.edits[e];if(c.start>r.length){n.warnInvalidEditStart(i.resultId,t.resultId,e,c.start,r.length),this._model.tokenization.setSemanticTokens(null,!0);return}let l=o-(c.start+c.deleteCount);l>0&&(X._copy(r,o-l,a,s-l,l),s-=l),c.data&&(X._copy(c.data,0,a,s-c.data.length,c.data.length),s-=c.data.length),o=c.start}o>0&&X._copy(r,0,a,0,o),t={resultId:t.resultId,data:a}}}if(j(t)){this._currentDocumentResponse=new re(e,t.resultId,t.data);let i=O(t,n,this._model.getLanguageId());if(r.length>0)for(let e of r)for(let t of i)for(let n of e.changes)t.applyEdit(n.range,n.text);this._model.tokenization.setSemanticTokens(i,!0)}else this._model.tokenization.setSemanticTokens(null,!0);a()}};Q=X=J([Y(1,f),Y(2,E),Y(3,n),Y(4,l)],Q);var re=class{constructor(e,t,n){this.provider=e,this.resultId=t,this.data=n}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}};_(Z);function ie(e,t){let n=globalThis.MonacoEnvironment;if(n?.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(e){console.error(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){console.error(e);return}}var $=typeof self==`object`&&self.constructor&&self.constructor.name===`DedicatedWorkerGlobalScope`&&globalThis.workerttPolicy!==void 0?globalThis.workerttPolicy:ie(`defaultWorkerFactory`,{createScriptURL:e=>e});function ae(e){let t=e.label,n=globalThis.MonacoEnvironment;if(n){if(typeof n.getWorker==`function`)return n.getWorker(`workerMain.js`,t);if(typeof n.getWorkerUrl==`function`){let e=n.getWorkerUrl(`workerMain.js`,t);return new Worker($?$.createScriptURL(e):e,{name:t,type:`module`})}}if(e.createWorker)return e.createWorker();throw Error(`You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker`)}function oe(e){let t=Promise.resolve(ae({label:e.label??`monaco-editor-worker`,moduleId:e.moduleId,createWorker:e.createWorker})).then(t=>(t.postMessage(`ignore`),t.postMessage(e.createData),t));return v.createWebWorker({worker:t,host:e.host,keepIdleModels:e.keepIdleModels})}export{oe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./register-
|
|
1
|
+
import{_ as e}from"./register-1w1Zr3b2.js";var t={comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<`,`>`]],autoClosingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],surroundingPairs:[{open:`<`,close:`>`},{open:`'`,close:`'`},{open:`"`,close:`"`}],onEnterRules:[{beforeText:RegExp(`<([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},n={defaultToken:``,tokenPostfix:`.xml`,ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,``],{include:`@whitespace`},[/(<)(@qualifiedName)/,[{token:`delimiter`},{token:`tag`,next:`@tag`}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:`delimiter`},{token:`tag`},``,{token:`delimiter`}]],[/(<\?)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/(<\!)(@qualifiedName)/,[{token:`delimiter`},{token:`metatag`,next:`@tag`}]],[/<\!\[CDATA\[/,{token:`delimiter.cdata`,next:`@cdata`}],[/&\w+;/,`string.escape`]],cdata:[[/[^\]]+/,``],[/\]\]>/,{token:`delimiter.cdata`,next:`@pop`}],[/\]/,``]],tag:[[/[ \t\r\n]+/,``],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,[`attribute.name`,``,`attribute.value`]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,[`attribute.name`,``,`attribute.value`]],[/@qualifiedName/,`attribute.name`],[/\?>/,{token:`delimiter`,next:`@pop`}],[/(\/)(>)/,[{token:`tag`},{token:`delimiter`,next:`@pop`}]],[/>/,{token:`delimiter`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/<!--/,{token:`comment`,next:`@comment`}]],comment:[[/[^<\-]+/,`comment.content`],[/-->/,{token:`comment`,next:`@pop`}],[/<!--/,`comment.content.invalid`],[/[<\-]/,`comment.content`]]}};export{t as conf,n as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./register-
|
|
1
|
+
import{_ as e}from"./register-1w1Zr3b2.js";var t={comments:{lineComment:`#`},brackets:[[`{`,`}`],[`[`,`]`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},n={tokenPostfix:`.yaml`,brackets:[{token:`delimiter.bracket`,open:`{`,close:`}`},{token:`delimiter.square`,open:`[`,close:`]`}],keywords:[`true`,`True`,`TRUE`,`false`,`False`,`FALSE`,`null`,`Null`,`Null`,`~`],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:`@whitespace`},{include:`@comment`},[/%[^ ]+.*$/,`meta.directive`],[/---/,`operators.directivesEnd`],[/\.{3}/,`operators.documentEnd`],[/[-?:](?= )/,`operators`],{include:`@anchor`},{include:`@tagHandle`},{include:`@flowCollections`},{include:`@blockStyle`},[/@numberInteger(?![ \t]*\S+)/,`number`],[/@numberFloat(?![ \t]*\S+)/,`number.float`],[/@numberOctal(?![ \t]*\S+)/,`number.octal`],[/@numberHex(?![ \t]*\S+)/,`number.hex`],[/@numberInfinity(?![ \t]*\S+)/,`number.infinity`],[/@numberNaN(?![ \t]*\S+)/,`number.nan`],[/@numberDate(?![ \t]*\S+)/,`number.date`],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,[`type`,`white`,`operators`,`white`]],{include:`@flowScalars`},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],object:[{include:`@whitespace`},{include:`@comment`},[/\}/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],[/:(?= )/,`operators`],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,`type`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\},]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],array:[{include:`@whitespace`},{include:`@comment`},[/\]/,`@brackets`,`@pop`],[/,/,`delimiter.comma`],{include:`@flowCollections`},{include:`@flowScalars`},{include:`@tagHandle`},{include:`@anchor`},{include:`@flowNumber`},[/[^\],]+/,{cases:{"@keywords":`keyword`,"@default":`string`}}]],multiString:[[/^( +).+$/,`string`,`@multiStringContinued.$1`]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":`string`,"@default":{token:`@rematch`,next:`@popall`}}}]],whitespace:[[/[ \t\r\n]+/,`white`]],comment:[[/#.*$/,`comment`]],flowCollections:[[/\[/,`@brackets`,`@array`],[/\{/,`@brackets`,`@object`]],flowScalars:[[/"([^"\\]|\\.)*$/,`string.invalid`],[/'([^'\\]|\\.)*$/,`string.invalid`],[/'[^']*'/,`string`],[/"/,`string`,`@doubleQuotedString`]],doubleQuotedString:[[/[^\\"]+/,`string`],[/@escapes/,`string.escape`],[/\\./,`string.escape.invalid`],[/"/,`string`,`@pop`]],blockStyle:[[/[>|][0-9]*[+-]?$/,`operators`,`@multiString`]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,`number`],[/@numberFloat(?=[ \t]*[,\]\}])/,`number.float`],[/@numberOctal(?=[ \t]*[,\]\}])/,`number.octal`],[/@numberHex(?=[ \t]*[,\]\}])/,`number.hex`],[/@numberInfinity(?=[ \t]*[,\]\}])/,`number.infinity`],[/@numberNaN(?=[ \t]*[,\]\}])/,`number.nan`],[/@numberDate(?=[ \t]*[,\]\}])/,`number.date`]],tagHandle:[[/\![^ ]*/,`tag`]],anchor:[[/[&*][^ ]+/,`namespace`]]}};export{t as conf,n as language};
|
package/studio/web/index.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
} catch (e) {}
|
|
22
22
|
})();
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/assets/index-DGRAzvO4.js"></script>
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/vendor-core-BdkdbUek.js">
|
|
27
27
|
<link rel="modulepreload" crossorigin href="/assets/vendor-datadog-fCQhBHGk.js">
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// 5.3.0 — introduces system.hdb_oidc_trust and system.hdb_oidc_token_use for OIDC trusted
|
|
4
|
-
// publishing (#2171).
|
|
4
|
+
// publishing (#2171), and system.hdb_model_decisions and system.hdb_model_outcomes for durable
|
|
5
|
+
// decisions and their recorded outcomes (#2840).
|
|
5
6
|
//
|
|
6
|
-
// Fresh installs get
|
|
7
|
+
// Fresh installs get these tables from json/systemSchema.json; this covers existing installs, and the
|
|
8
|
+
// replay table's full shape is also declared on every boot (security/authn/oidc/tokenUseTable.ts). The
|
|
7
9
|
// version must match the release that ships the dependent operations — see 5-1-0.ts for what
|
|
8
10
|
// happens when it does not, and DESIGN.md "System table bootstrap" for the three touchpoints.
|
|
9
11
|
|
|
@@ -13,60 +15,24 @@ import * as terms from '../../utility/hdbTerms.ts';
|
|
|
13
15
|
import * as initPaths from '../../dataLayer/harperBridge/lmdbBridge/lmdbUtility/initializePaths.js';
|
|
14
16
|
import bridge from '../../dataLayer/harperBridge/harperBridge.ts';
|
|
15
17
|
import hdbLogger from '../../utility/logging/harper_logger.ts';
|
|
18
|
+
import { declareTokenUseTable } from '../../security/authn/oidc/tokenUseTable.ts';
|
|
16
19
|
|
|
17
20
|
const OIDC_TRUST_TABLE = terms.SYSTEM_TABLE_NAMES.OIDC_TRUST_TABLE_NAME;
|
|
18
21
|
const OIDC_TOKEN_USE_TABLE = terms.SYSTEM_TABLE_NAMES.OIDC_TOKEN_USE_TABLE_NAME;
|
|
22
|
+
const MODEL_DECISIONS_TABLE = terms.SYSTEM_TABLE_NAMES.MODEL_DECISIONS_TABLE_NAME;
|
|
23
|
+
const MODEL_OUTCOMES_TABLE = terms.SYSTEM_TABLE_NAMES.MODEL_OUTCOMES_TABLE_NAME;
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* that question entirely rather than depending on how replication treats a row for an unknown table.
|
|
25
|
-
*
|
|
26
|
-
* Only the primary key is declared here. The `expiresAt` TTL attribute is not expressible through
|
|
27
|
-
* CreateTableObject, so tokenExchange.ts layers it on with an unconditional `table()` call — the
|
|
28
|
-
* same two-step hdb_certificate_cache uses.
|
|
29
|
-
*
|
|
30
|
-
* KNOWN LIMITATION, shared with hdb_certificate_cache rather than specific to this table: that
|
|
31
|
-
* second step runs on the exchange path, so a node that never performs an exchange — the passive
|
|
32
|
-
* members of a cluster, which is most of them when CI always targets one endpoint — has the table
|
|
33
|
-
* from this directive but never registers `expiresAt` locally. Replicated replay rows still land
|
|
34
|
-
* there (that is what `audit: true` buys) but get no eviction, so the table grows on exactly the
|
|
35
|
-
* nodes doing no work. Rows are small and bounded by exchange volume, so this is slow rather than
|
|
36
|
-
* dangerous. Fixing it properly means installing the TTL at system-table setup instead of on first
|
|
37
|
-
* use, which is a change to how every lazily-extended system table is provisioned — worth doing
|
|
38
|
-
* once, for both tables, rather than special-casing this one.
|
|
26
|
+
* Not skipped when the table exists: the node that upgrades second can already hold a copy its
|
|
27
|
+
* pre-upgrade replication handshake created from a peer, which carries attribute names but not the
|
|
28
|
+
* table's expiration.
|
|
39
29
|
*/
|
|
40
|
-
async function
|
|
41
|
-
if (databases.system?.[OIDC_TOKEN_USE_TABLE]) {
|
|
42
|
-
hdbLogger.info(`system.${OIDC_TOKEN_USE_TABLE}
|
|
43
|
-
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
hdbLogger.info(`Creating system.${OIDC_TOKEN_USE_TABLE} table for OIDC replay protection.`);
|
|
48
|
-
|
|
49
|
-
const CreateTableObject =
|
|
50
|
-
require('../../dataLayer/CreateTableObject').default || require('../../dataLayer/CreateTableObject');
|
|
51
|
-
const schema = (systemSchema as any)[OIDC_TOKEN_USE_TABLE];
|
|
52
|
-
if (!schema) {
|
|
53
|
-
throw new Error(`systemSchema.${OIDC_TOKEN_USE_TABLE} is missing; cannot run 5.3.0 directive.`);
|
|
30
|
+
async function declareHdbOidcTokenUse() {
|
|
31
|
+
if (!databases.system?.[OIDC_TOKEN_USE_TABLE]) {
|
|
32
|
+
hdbLogger.info(`Creating system.${OIDC_TOKEN_USE_TABLE} table for OIDC replay protection.`);
|
|
33
|
+
initPaths.initSystemSchemaPaths(terms.SYSTEM_SCHEMA_NAME, OIDC_TOKEN_USE_TABLE);
|
|
54
34
|
}
|
|
55
|
-
|
|
56
|
-
initPaths.initSystemSchemaPaths(terms.SYSTEM_SCHEMA_NAME, OIDC_TOKEN_USE_TABLE);
|
|
57
|
-
const createTable = new (CreateTableObject as any)(
|
|
58
|
-
terms.SYSTEM_SCHEMA_NAME,
|
|
59
|
-
OIDC_TOKEN_USE_TABLE,
|
|
60
|
-
schema.hash_attribute
|
|
61
|
-
);
|
|
62
|
-
createTable.attributes = schema.attributes;
|
|
63
|
-
const primaryKeyAttribute = createTable.attributes.find(({ attribute }) => attribute === schema.hash_attribute);
|
|
64
|
-
if (primaryKeyAttribute) primaryKeyAttribute.isPrimaryKey = true;
|
|
65
|
-
// Must match `"audit": true` in systemSchema.json — and here auditing is not cosmetic: it is the
|
|
66
|
-
// replication change feed, without which replay protection would be node-local.
|
|
67
|
-
createTable.audit = true;
|
|
68
|
-
|
|
69
|
-
await bridge.createTable(OIDC_TOKEN_USE_TABLE, createTable);
|
|
35
|
+
declareTokenUseTable();
|
|
70
36
|
await patchIsHashAttribute(OIDC_TOKEN_USE_TABLE);
|
|
71
37
|
}
|
|
72
38
|
|
|
@@ -103,9 +69,8 @@ async function createHdbOidcTrustIfMissing() {
|
|
|
103
69
|
*
|
|
104
70
|
* harperdb@4.x reads is_hash_attribute from __dbis__ to derive the LMDB DBI open flags; without it
|
|
105
71
|
* the DBI is opened with the opposite flags (DUPSORT set) and LMDB throws MDB_INCOMPATIBLE, breaking
|
|
106
|
-
* downgrade — the same guard 5-1-0.ts and 5-2-0.ts apply to their tables
|
|
107
|
-
*
|
|
108
|
-
* one would be a silent asymmetry rather than a decision. Idempotent: no-op when already set.
|
|
72
|
+
* downgrade — the same guard 5-1-0.ts and 5-2-0.ts apply to their tables, so every table here gets it.
|
|
73
|
+
* Idempotent: no-op when already set.
|
|
109
74
|
*/
|
|
110
75
|
async function patchIsHashAttribute(tableName: string) {
|
|
111
76
|
const systemTable = (databases as any).system?.[tableName];
|
|
@@ -122,11 +87,53 @@ async function patchIsHashAttribute(tableName: string) {
|
|
|
122
87
|
);
|
|
123
88
|
}
|
|
124
89
|
|
|
90
|
+
/** `audit: true` must match systemSchema.json: both decision tables replicate. */
|
|
91
|
+
async function createSystemTableIfMissing(tableName: string, purpose: string) {
|
|
92
|
+
if (databases.system?.[tableName]) {
|
|
93
|
+
hdbLogger.info(`system.${tableName} already exists; skipping create.`);
|
|
94
|
+
await patchIsHashAttribute(tableName);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
hdbLogger.info(`Creating system.${tableName} table for ${purpose}.`);
|
|
99
|
+
|
|
100
|
+
const CreateTableObject =
|
|
101
|
+
require('../../dataLayer/CreateTableObject').default || require('../../dataLayer/CreateTableObject');
|
|
102
|
+
const schema = (systemSchema as any)[tableName];
|
|
103
|
+
if (!schema) {
|
|
104
|
+
throw new Error(`systemSchema.${tableName} is missing; cannot run 5.3.0 directive.`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
initPaths.initSystemSchemaPaths(terms.SYSTEM_SCHEMA_NAME, tableName);
|
|
108
|
+
const createTable = new (CreateTableObject as any)(terms.SYSTEM_SCHEMA_NAME, tableName, schema.hash_attribute);
|
|
109
|
+
createTable.attributes = schema.attributes;
|
|
110
|
+
const primaryKeyAttribute = createTable.attributes.find(({ attribute }) => attribute === schema.hash_attribute);
|
|
111
|
+
if (primaryKeyAttribute) primaryKeyAttribute.isPrimaryKey = true;
|
|
112
|
+
createTable.audit = true;
|
|
113
|
+
|
|
114
|
+
await bridge.createTable(tableName, createTable);
|
|
115
|
+
await patchIsHashAttribute(tableName);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function createHdbModelDecisionsIfMissing() {
|
|
119
|
+
await createSystemTableIfMissing(MODEL_DECISIONS_TABLE, 'durable model decisions');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async function createHdbModelOutcomesIfMissing() {
|
|
123
|
+
await createSystemTableIfMissing(MODEL_OUTCOMES_TABLE, 'recorded decision outcomes');
|
|
124
|
+
}
|
|
125
|
+
|
|
125
126
|
const directive530 = {
|
|
126
127
|
version: '5.3.0',
|
|
127
|
-
description:
|
|
128
|
+
description:
|
|
129
|
+
'create system.hdb_oidc_trust and system.hdb_oidc_token_use tables for OIDC trusted publishing, and system.hdb_model_decisions and system.hdb_model_outcomes for durable decisions',
|
|
128
130
|
sync_functions: [] as Array<() => unknown>,
|
|
129
|
-
async_functions: [
|
|
131
|
+
async_functions: [
|
|
132
|
+
createHdbOidcTrustIfMissing,
|
|
133
|
+
declareHdbOidcTokenUse,
|
|
134
|
+
createHdbModelDecisionsIfMissing,
|
|
135
|
+
createHdbModelOutcomesIfMissing,
|
|
136
|
+
] as Array<() => Promise<unknown>>,
|
|
130
137
|
};
|
|
131
138
|
|
|
132
139
|
export default [directive530];
|
package/utility/DESIGN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Cross-cutting helpers.
|
|
4
4
|
|
|
5
|
-
**Read this when:** touching `watchPath.ts` or anything that arms a native file watch,
|
|
5
|
+
**Read this when:** touching `watchPath.ts` or anything that arms a native file watch, adding an interactive CLI prompt (`interactivePrompts.ts`), or passing an object to `handleHDBError` (`errors/hdbError.ts`).
|
|
6
6
|
|
|
7
7
|
Index of every design note: [DESIGN.md](../DESIGN.md).
|
|
8
8
|
|
|
@@ -57,3 +57,7 @@ that degrades to polling stays there for its lifetime, so a caller with no polli
|
|
|
57
57
|
## Interactive CLI prompts go through `utility/interactivePrompts.ts`
|
|
58
58
|
|
|
59
59
|
Every `@inquirer`-based one-shot prompt in the codebase (`bin/login.ts`, `bin/deploySetup.ts`, `utility/install/installer.ts`, `upgrade/upgradePrompt.ts`) calls the `prompts` object (or `promptYesNo`) exported from `utility/interactivePrompts.ts` — never `@inquirer/*` directly. Reuse that seam for any new `@inquirer`-style prompt rather than importing an `@inquirer` subpath yourself: it lazy-loads each prompt package on first real call (this module sits on the server boot path via `upgradePrompt`, so eager imports would cost every rolling-restart node), restores clean-exit-on-Ctrl-C (`ExitPromptError` → exit 130, not a logged stack), and disables the password prompt's plaintext-reveal keypress. `rawPromptsForTesting` is the underlying, pre-guard layer tests stub — `@inquirer/*` packages are real ES modules, so `require('@inquirer/input').default = stub` silently no-ops even through CJS interop. Out of scope: line-oriented REPLs like `bin/agentCli.ts`'s `readline.question` flow are a different interaction model and don't go through this seam.
|
|
60
|
+
|
|
61
|
+
## An HdbError's `message` is a string; the structured body is `http_resp_msg` (`utility/errors/hdbError.ts`)
|
|
62
|
+
|
|
63
|
+
`handleHDBError(new Error(), <object>, status)` is how a permission report or validation report becomes an error: the object is the response body. `serverErrorHandler` sends an object `http_resp_msg` verbatim, and the job worker (`server/jobs/jobProcess.ts`) records it as the job's `message`, which is what `get_job` answers a refused bulk load with. The constructor derives `message` from it — the `error` summary followed by the reasons the object lists, anything else through `inspectForLog`, which cannot throw and does not expose a nested Error's properties — because the logger, `String(error)` and `errorToString` (HTTP error bodies, replication replies) all need a string. A non-string `message` rendered as `Error: [object Object]`. Read the structure from `http_resp_msg`, never from `message`.
|
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import logger from '../logging/harper_logger.ts';
|
|
2
|
+
import logger, { errorToString, inspectForLog, isErrorLike } from '../logging/harper_logger.ts';
|
|
3
3
|
import * as hdbErrors from './commonErrors.ts';
|
|
4
4
|
import * as hdbTerms from '../hdbTerms.ts';
|
|
5
5
|
|
|
6
|
+
// `message` must be a string even for a structured response message; inspectForLog renders what is
|
|
7
|
+
// not a report without throwing or exposing a nested Error's properties.
|
|
8
|
+
function messageText(message: any): string {
|
|
9
|
+
if (typeof message === 'string') return message;
|
|
10
|
+
try {
|
|
11
|
+
if (typeof message.message === 'string') return message.message;
|
|
12
|
+
const { error, ...detail } = message;
|
|
13
|
+
if (typeof error === 'string') {
|
|
14
|
+
const reasons = Object.values(detail)
|
|
15
|
+
.flat()
|
|
16
|
+
.filter(
|
|
17
|
+
(reason) =>
|
|
18
|
+
reason != null && (typeof reason !== 'object' || isErrorLike(reason) || Object.keys(reason).length > 0)
|
|
19
|
+
)
|
|
20
|
+
.map(reasonText);
|
|
21
|
+
return reasons.length > 0 ? `${error}: ${reasons.join('; ')}` : error;
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
// a getter or proxy that throws
|
|
25
|
+
}
|
|
26
|
+
return renderValue(message);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function reasonText(reason: any): string {
|
|
30
|
+
if (typeof reason === 'string') return reason;
|
|
31
|
+
return isErrorLike(reason) ? errorToString(reason) : renderValue(reason);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function renderValue(value: any): string {
|
|
35
|
+
return String(inspectForLog(value, { breakLength: Infinity, depth: 4 }));
|
|
36
|
+
}
|
|
37
|
+
|
|
6
38
|
/**
|
|
7
39
|
* Custom error class used for better error and log handling. Caught errors that evaluate to an instanceof HdbError can
|
|
8
40
|
* be handled differently - e.g. in most cases caught HdbError likely would not need to be logged since that should have
|
|
@@ -15,7 +47,7 @@ export class HdbError extends Error {
|
|
|
15
47
|
logLevel: string;
|
|
16
48
|
/**
|
|
17
49
|
* @param {Error} errOrig - Error to be translated into HdbError. If manually throwing an error, pass `new Error()` to ensure stack trace is maintained
|
|
18
|
-
* @param {String} [httpMsg] - optional - response message that will be returned via the API
|
|
50
|
+
* @param {String|Object} [httpMsg] - optional - response message that will be returned via the API
|
|
19
51
|
* @param {Number} [httpCode] - optional - response status code that will be returned via the API
|
|
20
52
|
* @param {String} [logLevel] - optional - log level that will be used for logging of this error
|
|
21
53
|
* @param {String} [logMsg] - optional - log message that, if provided, will be logged at the `logLevel` above
|
|
@@ -32,15 +64,10 @@ export class HdbError extends Error {
|
|
|
32
64
|
: hdbErrors.DEFAULT_ERROR_MSGS[httpCode]
|
|
33
65
|
? hdbErrors.DEFAULT_ERROR_MSGS[httpCode]
|
|
34
66
|
: hdbErrors.DEFAULT_ERROR_MSGS[hdbErrors.HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR];
|
|
35
|
-
this.message = errOrig.message ? errOrig.message : this.http_resp_msg;
|
|
67
|
+
this.message = messageText(errOrig.message ? errOrig.message : this.http_resp_msg);
|
|
36
68
|
this.type = errOrig.name;
|
|
37
69
|
if (logLevel) this.logLevel = logLevel;
|
|
38
70
|
|
|
39
|
-
//This ensures that the error stack does not include [object Object] if the error message is not a string
|
|
40
|
-
if (typeof this.message !== 'string') {
|
|
41
|
-
this.stack = errOrig.stack;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
71
|
if (logMsg) {
|
|
45
72
|
logger[logLevel](logMsg);
|
|
46
73
|
}
|
|
@@ -78,6 +105,27 @@ export class DerivedIndexLagError extends ServerError {
|
|
|
78
105
|
}
|
|
79
106
|
}
|
|
80
107
|
|
|
108
|
+
/** Retryable admission failure while a database is draining writes for close, restore, or drop. */
|
|
109
|
+
export class DatabaseClosingError extends ServerError {
|
|
110
|
+
code: string;
|
|
111
|
+
retryable: boolean;
|
|
112
|
+
constructor(databaseName: string, retryable = true) {
|
|
113
|
+
super(`Database '${databaseName}' is closing; retry after it is available`, 503);
|
|
114
|
+
this.name = 'DatabaseClosingError';
|
|
115
|
+
this.code = 'DATABASE_CLOSING';
|
|
116
|
+
this.retryable = retryable;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export class DatabaseDrainTimeoutError extends DatabaseClosingError {
|
|
121
|
+
constructor(databaseName: string, timeoutMilliseconds: number) {
|
|
122
|
+
super(databaseName);
|
|
123
|
+
this.message = `Timed out after ${timeoutMilliseconds}ms waiting for database '${databaseName}' writes to drain; retry the operation`;
|
|
124
|
+
this.name = 'DatabaseDrainTimeoutError';
|
|
125
|
+
this.code = 'DATABASE_DRAIN_TIMEOUT';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
81
129
|
/**
|
|
82
130
|
* Thrown when a query targets an attribute whose secondary index is still being (re)built. It is a
|
|
83
131
|
* distinct, retryable 503 so callers can tell a transient "index rebuilding" condition apart from a
|
package/utility/fsync.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fsyncSync } from 'node:fs';
|
|
2
|
+
|
|
3
|
+
// These codes mean the platform or filesystem cannot flush this handle, not that the write failed.
|
|
4
|
+
const UNSUPPORTED_SYNC_CODES = new Set(['EPERM', 'EINVAL', 'ENOTSUP', 'EOPNOTSUPP', 'EBADF', 'EISDIR']);
|
|
5
|
+
|
|
6
|
+
export function isUnsupportedSyncError(error: unknown): boolean {
|
|
7
|
+
return UNSUPPORTED_SYNC_CODES.has((error as NodeJS.ErrnoException)?.code ?? '');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function fsyncTolerantSync(fd: number): void {
|
|
11
|
+
try {
|
|
12
|
+
fsyncSync(fd);
|
|
13
|
+
} catch (error) {
|
|
14
|
+
if (!isUnsupportedSyncError(error)) throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
package/utility/hdbTerms.ts
CHANGED
|
@@ -216,6 +216,8 @@ export const SYSTEM_TABLE_NAMES = {
|
|
|
216
216
|
SECRET_TABLE_NAME: 'hdb_secret',
|
|
217
217
|
OIDC_TRUST_TABLE_NAME: 'hdb_oidc_trust',
|
|
218
218
|
OIDC_TOKEN_USE_TABLE_NAME: 'hdb_oidc_token_use',
|
|
219
|
+
MODEL_DECISIONS_TABLE_NAME: 'hdb_model_decisions',
|
|
220
|
+
MODEL_OUTCOMES_TABLE_NAME: 'hdb_model_outcomes',
|
|
219
221
|
} as const;
|
|
220
222
|
|
|
221
223
|
/** Hash attribute for the system info table */
|
|
@@ -954,6 +956,7 @@ export const ITC_EVENT_TYPES = {
|
|
|
954
956
|
GET_METRICS: 'get_metrics',
|
|
955
957
|
RESTART: 'restart',
|
|
956
958
|
START_JOB: 'start_job',
|
|
959
|
+
JOB_CLEANUP_COMPLETE: 'job_cleanup_complete',
|
|
957
960
|
COMPONENT_STATUS_REQUEST: 'component_status_request',
|
|
958
961
|
COMPONENT_STATUS_RESPONSE: 'component_status_response',
|
|
959
962
|
RESOURCE_OPENAPI_REQUEST: 'resource_openapi_request',
|
package/utility/signalling.ts
CHANGED
|
@@ -4,25 +4,54 @@ import * as hdbTerms from './hdbTerms.ts';
|
|
|
4
4
|
import hdbLogger from '../utility/logging/harper_logger.ts';
|
|
5
5
|
import ITCEventObject from '../server/itc/utility/ITCEventObject.js';
|
|
6
6
|
let serverItcHandlers;
|
|
7
|
-
import { sendItcEvent } from '../server/threads/itc.js';
|
|
7
|
+
import { sendItcEvent, sendItcEventStrict } from '../server/threads/itc.js';
|
|
8
8
|
|
|
9
9
|
// Await BOTH the local handler and the cross-worker broadcast. The local handler is what
|
|
10
10
|
// rebuilds THIS thread's cache; firing it un-awaited let the originating worker return success
|
|
11
11
|
// before its own cache caught up, so the next request it served observed stale state even though
|
|
12
12
|
// the op awaited propagation to the other workers — the originator half of #1497. Both legs
|
|
13
13
|
// resolve without rejecting (each handler has its own try/catch; the broadcast always resolves),
|
|
14
|
-
// so Promise.all is safe here.
|
|
15
|
-
|
|
14
|
+
// so Promise.all is safe here. Destructive abort/completion can order peers first so the local
|
|
15
|
+
// admission fence remains in place until remote workers have processed the same transition.
|
|
16
|
+
export async function signalSchemaChange(
|
|
17
|
+
message: any,
|
|
18
|
+
{
|
|
19
|
+
peersFirst = false,
|
|
20
|
+
includeJobWorkers = false,
|
|
21
|
+
peerRounds = 1,
|
|
22
|
+
}: { peersFirst?: boolean; includeJobWorkers?: boolean | 'active'; peerRounds?: number } = {}
|
|
23
|
+
) {
|
|
16
24
|
try {
|
|
17
25
|
hdbLogger.debug('signalSchemaChange called with message:', message);
|
|
18
26
|
serverItcHandlers = serverItcHandlers || require('../server/itc/serverHandlers.js');
|
|
19
27
|
const itcEventSchema = new ITCEventObject(hdbTerms.ITC_EVENT_TYPES.SCHEMA, message);
|
|
20
|
-
|
|
28
|
+
if (peersFirst) {
|
|
29
|
+
await sendItcEvent(itcEventSchema, includeJobWorkers);
|
|
30
|
+
await serverItcHandlers.schema(itcEventSchema);
|
|
31
|
+
for (let round = 1; round < peerRounds; round++) {
|
|
32
|
+
await new Promise(setImmediate);
|
|
33
|
+
await sendItcEvent(itcEventSchema, includeJobWorkers);
|
|
34
|
+
}
|
|
35
|
+
} else
|
|
36
|
+
await Promise.all([serverItcHandlers.schema(itcEventSchema), sendItcEvent(itcEventSchema, includeJobWorkers)]);
|
|
21
37
|
} catch (err) {
|
|
22
38
|
hdbLogger.error(err);
|
|
23
39
|
}
|
|
24
40
|
}
|
|
25
41
|
|
|
42
|
+
/** Prepare peer workers for destructive DDL without applying the completion event locally. */
|
|
43
|
+
export async function signalSchemaChangeToPeers(message: any): Promise<void> {
|
|
44
|
+
hdbLogger.debug('signalSchemaChangeToPeers called with message:', message);
|
|
45
|
+
const itcEventSchema = new ITCEventObject(hdbTerms.ITC_EVENT_TYPES.SCHEMA, message);
|
|
46
|
+
// Commit draining can consume 120 seconds and native derived-index shutdown another 70. The
|
|
47
|
+
// extra round closes the topology race: after the main thread installs the preparation fence, any
|
|
48
|
+
// worker started during round one inherits it and is present for round two.
|
|
49
|
+
for (let round = 0; round < 2; round++) {
|
|
50
|
+
await sendItcEventStrict(itcEventSchema, 210_000, true);
|
|
51
|
+
if (round === 0) await new Promise(setImmediate);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
26
55
|
/**
|
|
27
56
|
* Notify local listeners that JS resources have just been registered (resources.js loaded). This is
|
|
28
57
|
* deliberately local-only — no ITC broadcast — because every worker registers its own JS resources,
|
package/utility/when.ts
CHANGED
|
@@ -18,3 +18,25 @@ export function promiseNormalize<T>(returnValue: T | Promise<T>, target: Request
|
|
|
18
18
|
}
|
|
19
19
|
return returnValue;
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
export async function settleBeforeDeadline(
|
|
23
|
+
promises: Iterable<PromiseLike<unknown>>,
|
|
24
|
+
deadline: number,
|
|
25
|
+
timeoutError: () => Error
|
|
26
|
+
): Promise<void> {
|
|
27
|
+
const pending = [...promises];
|
|
28
|
+
if (pending.length === 0) return;
|
|
29
|
+
const remaining = deadline - Date.now();
|
|
30
|
+
if (remaining <= 0) throw timeoutError();
|
|
31
|
+
let timer: NodeJS.Timeout;
|
|
32
|
+
try {
|
|
33
|
+
await Promise.race([
|
|
34
|
+
Promise.allSettled(pending),
|
|
35
|
+
new Promise<never>((_resolve, reject) => {
|
|
36
|
+
timer = setTimeout(() => reject(timeoutError()), remaining);
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
39
|
+
} finally {
|
|
40
|
+
clearTimeout(timer!);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -187,21 +187,50 @@ const bedrockEntrySchema = Joi.object({
|
|
|
187
187
|
region: string.optional(),
|
|
188
188
|
...commonEntryFields,
|
|
189
189
|
}).unknown(false);
|
|
190
|
+
// No `model` field: the adapter names a generative logical name, not a provider model.
|
|
191
|
+
const generativeDecisionEntrySchema = Joi.object({
|
|
192
|
+
backend: string.valid('generative').required(),
|
|
193
|
+
generative: string.optional(),
|
|
194
|
+
samples: number.integer().min(1).max(25).optional(),
|
|
195
|
+
concurrency: number.integer().min(1).max(25).optional(),
|
|
196
|
+
temperature: number.min(0).optional(),
|
|
197
|
+
requestTimeoutMs: number.min(1).optional(),
|
|
198
|
+
scoring: string.valid('auto', 'vote', 'score').optional(),
|
|
199
|
+
requireStructuredOutput: Joi.boolean().optional(),
|
|
200
|
+
fallback: Joi.array().items(string).optional(),
|
|
201
|
+
}).unknown(false);
|
|
190
202
|
const unknownBackendEntrySchema = Joi.object({
|
|
191
203
|
backend: string.required(),
|
|
192
204
|
}).unknown(true);
|
|
193
|
-
|
|
205
|
+
// A built-in that cannot serve the kind it is listed under fails here, with the kind named, rather
|
|
206
|
+
// than passing as a module specifier and failing at boot.
|
|
207
|
+
function rejectWrongKind(kind) {
|
|
208
|
+
return (value, helpers) => helpers.message(`backend '${value.backend}' cannot serve models.${kind} entries`);
|
|
209
|
+
}
|
|
210
|
+
const wrongKindEntrySchema = (kind) =>
|
|
211
|
+
Joi.object({ backend: string.required() }).unknown(true).custom(rejectWrongKind(kind));
|
|
212
|
+
const providerEntrySchema = (kind) =>
|
|
213
|
+
Joi.alternatives().conditional('.backend', {
|
|
214
|
+
switch: [
|
|
215
|
+
{ is: 'ollama', then: ollamaEntrySchema },
|
|
216
|
+
{ is: 'openai', then: openaiEntrySchema },
|
|
217
|
+
{ is: 'anthropic', then: anthropicEntrySchema },
|
|
218
|
+
{ is: 'bedrock', then: bedrockEntrySchema },
|
|
219
|
+
{ is: 'generative', then: wrongKindEntrySchema(kind) },
|
|
220
|
+
],
|
|
221
|
+
otherwise: unknownBackendEntrySchema,
|
|
222
|
+
});
|
|
223
|
+
const decisionEntrySchema = Joi.alternatives().conditional('.backend', {
|
|
194
224
|
switch: [
|
|
195
|
-
{ is: '
|
|
196
|
-
{ is: 'openai', then:
|
|
197
|
-
{ is: 'anthropic', then: anthropicEntrySchema },
|
|
198
|
-
{ is: 'bedrock', then: bedrockEntrySchema },
|
|
225
|
+
{ is: 'generative', then: generativeDecisionEntrySchema },
|
|
226
|
+
{ is: Joi.valid('ollama', 'openai', 'anthropic', 'bedrock'), then: wrongKindEntrySchema('decision') },
|
|
199
227
|
],
|
|
200
228
|
otherwise: unknownBackendEntrySchema,
|
|
201
229
|
});
|
|
202
230
|
const modelsSchema = Joi.object({
|
|
203
|
-
embedding: Joi.object().pattern(Joi.string(),
|
|
204
|
-
generative: Joi.object().pattern(Joi.string(),
|
|
231
|
+
embedding: Joi.object().pattern(Joi.string(), providerEntrySchema('embedding')).optional(),
|
|
232
|
+
generative: Joi.object().pattern(Joi.string(), providerEntrySchema('generative')).optional(),
|
|
233
|
+
decision: Joi.object().pattern(Joi.string(), decisionEntrySchema).optional(),
|
|
205
234
|
});
|
|
206
235
|
|
|
207
236
|
/**
|