@agimon-ai/doompi-author 0.0.1-alpha.2 → 0.0.1-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/apiContracts.cjs +316 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +311 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/authorCommand-B90ghX5J.mjs +226 -0
- package/dist/authorCommand-B90ghX5J.mjs.map +1 -0
- package/dist/authorCommand-Cd5dnLF7.cjs +315 -0
- package/dist/authorCommand-Cd5dnLF7.cjs.map +1 -0
- package/dist/authorFacade-B9-Re3Ga.mjs +75 -0
- package/dist/authorFacade-B9-Re3Ga.mjs.map +1 -0
- package/dist/authorFacade-BvCSzZ5K.cjs +104 -0
- package/dist/authorFacade-BvCSzZ5K.cjs.map +1 -0
- package/dist/authorFacade-RZ6EXlR5.d.mts +113 -0
- package/dist/authorFacade-RZ6EXlR5.d.mts.map +1 -0
- package/dist/authorFacade.cjs +26 -0
- package/dist/authorFacade.d.mts +3 -0
- package/dist/authorFacade.mjs +3 -0
- package/dist/extensions/pi.cjs +172 -1
- package/dist/extensions/pi.cjs.map +1 -0
- package/dist/extensions/pi.d.mts +6 -2
- package/dist/extensions/pi.d.mts.map +1 -0
- package/dist/extensions/pi.mjs +167 -1
- package/dist/extensions/pi.mjs.map +1 -0
- package/dist/extensions/server.cjs +659 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +652 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +4231 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index-Btm_xNOb.d.mts +386 -0
- package/dist/index-Btm_xNOb.d.mts.map +1 -0
- package/dist/index.cjs +35 -1
- package/dist/index.d.mts +2 -21
- package/dist/index.mjs +4 -1
- package/dist/monitor-7T5YF6px.mjs +70 -0
- package/dist/monitor-7T5YF6px.mjs.map +1 -0
- package/dist/monitor-BxY8s_AX.cjs +81 -0
- package/dist/monitor-BxY8s_AX.cjs.map +1 -0
- package/dist/structuredDocuments-Bg6DIqu5.cjs +960 -0
- package/dist/structuredDocuments-Bg6DIqu5.cjs.map +1 -0
- package/dist/structuredDocuments-CzMYD0Bq.mjs +810 -0
- package/dist/structuredDocuments-CzMYD0Bq.mjs.map +1 -0
- package/package.json +48 -38
- package/src/types/authorPreview.ts +76 -0
- package/src/types/webAuthor.ts +1 -1
- package/dist/_virtual/_rolldown/runtime.cjs +0 -1
- package/dist/adapters/authorApi.cjs +0 -2
- package/dist/adapters/authorApi.cjs.map +0 -1
- package/dist/adapters/authorBridgeApi.cjs +0 -2
- package/dist/adapters/authorBridgeApi.cjs.map +0 -1
- package/dist/adapters/authorDocumentApi.cjs +0 -2
- package/dist/adapters/authorDocumentApi.cjs.map +0 -1
- package/dist/adapters/pi/authorBridgeClient.cjs +0 -2
- package/dist/adapters/pi/authorBridgeClient.cjs.map +0 -1
- package/dist/adapters/pi/authorTools.cjs +0 -2
- package/dist/adapters/pi/authorTools.cjs.map +0 -1
- package/dist/adapters/pi/extension.cjs +0 -2
- package/dist/adapters/pi/extension.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/common.cjs +0 -2
- package/dist/adapters/structuredDocuments/common.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/csv.cjs +0 -7
- package/dist/adapters/structuredDocuments/csv.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/index.cjs +0 -2
- package/dist/adapters/structuredDocuments/index.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/markdownSlides.cjs +0 -6
- package/dist/adapters/structuredDocuments/markdownSlides.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/ooxmlArchive.cjs +0 -2
- package/dist/adapters/structuredDocuments/ooxmlArchive.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/pptx.cjs +0 -2
- package/dist/adapters/structuredDocuments/pptx.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/xlsx.cjs +0 -2
- package/dist/adapters/structuredDocuments/xlsx.cjs.map +0 -1
- package/dist/adapters/structuredDocuments/xmlText.cjs +0 -2
- package/dist/adapters/structuredDocuments/xmlText.cjs.map +0 -1
- package/dist/adapters/webAuthorChannel.cjs +0 -2
- package/dist/adapters/webAuthorChannel.cjs.map +0 -1
- package/dist/commands/doomAuthorCommand.cjs +0 -2
- package/dist/commands/doomAuthorCommand.cjs.map +0 -1
- package/dist/container/index.cjs +0 -2
- package/dist/container/index.cjs.map +0 -1
- package/dist/extensions/pi.d.cts +0 -2
- package/dist/index.d.cts +0 -21
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/engine/helpers/union.d.cts +0 -6
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/engine/helpers/union.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/engine/helpers/union.d.mts +0 -6
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/engine/helpers/union.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/_optional.d.cts +0 -7
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/_optional.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/_optional.d.mts +0 -7
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/_optional.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/object.d.cts +0 -12
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/object.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/object.d.mts +0 -12
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/object.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/properties.d.cts +0 -12
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/properties.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/properties.d.mts +0 -12
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/properties.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/record.d.cts +0 -9
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/record.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/record.d.mts +0 -9
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/record.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/schema.d.cts +0 -4
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/schema.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/schema.d.mts +0 -4
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/schema.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/string.d.cts +0 -9
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/string.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/string.d.mts +0 -9
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/string.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/unknown.d.cts +0 -8
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/unknown.d.cts.map +0 -1
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/unknown.d.mts +0 -8
- package/dist/node_modules/.pnpm/typebox@1.3.25/node_modules/typebox/build/type/types/unknown.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorApi.d.cts +0 -15
- package/dist/packages/minor/doompi-author/src/adapters/authorApi.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorApi.d.mts +0 -15
- package/dist/packages/minor/doompi-author/src/adapters/authorApi.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorApi.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/authorApi.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorBridgeApi.d.cts +0 -6
- package/dist/packages/minor/doompi-author/src/adapters/authorBridgeApi.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorBridgeApi.d.mts +0 -6
- package/dist/packages/minor/doompi-author/src/adapters/authorBridgeApi.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorBridgeApi.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/authorBridgeApi.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorDocumentApi.d.cts +0 -11
- package/dist/packages/minor/doompi-author/src/adapters/authorDocumentApi.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorDocumentApi.d.mts +0 -11
- package/dist/packages/minor/doompi-author/src/adapters/authorDocumentApi.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/authorDocumentApi.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/authorDocumentApi.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorBridgeClient.d.cts +0 -18
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorBridgeClient.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorBridgeClient.d.mts +0 -18
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorBridgeClient.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorBridgeClient.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorBridgeClient.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorTools.d.cts +0 -9
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorTools.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorTools.d.mts +0 -9
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorTools.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorTools.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/pi/authorTools.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/extension.d.cts +0 -19
- package/dist/packages/minor/doompi-author/src/adapters/pi/extension.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/extension.d.mts +0 -19
- package/dist/packages/minor/doompi-author/src/adapters/pi/extension.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/pi/extension.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/pi/extension.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/common.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/common.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/csv.d.cts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/csv.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/csv.d.mts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/csv.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/csv.mjs +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/csv.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/index.d.cts +0 -13
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/index.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/index.d.mts +0 -13
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/index.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/index.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/index.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/markdownSlides.d.cts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/markdownSlides.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/markdownSlides.d.mts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/markdownSlides.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/markdownSlides.mjs +0 -6
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/markdownSlides.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/ooxmlArchive.d.cts +0 -13
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/ooxmlArchive.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/ooxmlArchive.d.mts +0 -13
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/ooxmlArchive.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/ooxmlArchive.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/ooxmlArchive.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/pptx.d.cts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/pptx.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/pptx.d.mts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/pptx.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/pptx.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/pptx.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xlsx.d.cts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xlsx.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xlsx.d.mts +0 -7
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xlsx.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xlsx.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xlsx.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xmlText.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/structuredDocuments/xmlText.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/webAuthorChannel.d.cts +0 -6
- package/dist/packages/minor/doompi-author/src/adapters/webAuthorChannel.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/webAuthorChannel.d.mts +0 -6
- package/dist/packages/minor/doompi-author/src/adapters/webAuthorChannel.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/adapters/webAuthorChannel.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/adapters/webAuthorChannel.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/commands/doomAuthorCommand.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/commands/doomAuthorCommand.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/container/index.d.cts +0 -5
- package/dist/packages/minor/doompi-author/src/container/index.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/container/index.d.mts +0 -5
- package/dist/packages/minor/doompi-author/src/container/index.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/container/index.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/container/index.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/schemas/authorTools.d.cts +0 -16
- package/dist/packages/minor/doompi-author/src/schemas/authorTools.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/schemas/authorTools.d.mts +0 -16
- package/dist/packages/minor/doompi-author/src/schemas/authorTools.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/schemas/authorTools.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/schemas/authorTools.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorBridgeState.d.cts +0 -31
- package/dist/packages/minor/doompi-author/src/services/authorBridgeState.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorBridgeState.d.mts +0 -31
- package/dist/packages/minor/doompi-author/src/services/authorBridgeState.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorBridgeState.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/services/authorBridgeState.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorCatalog.d.cts +0 -10
- package/dist/packages/minor/doompi-author/src/services/authorCatalog.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorCatalog.d.mts +0 -10
- package/dist/packages/minor/doompi-author/src/services/authorCatalog.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorMode.d.cts +0 -19
- package/dist/packages/minor/doompi-author/src/services/authorMode.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorMode.d.mts +0 -19
- package/dist/packages/minor/doompi-author/src/services/authorMode.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/authorMode.mjs +0 -3
- package/dist/packages/minor/doompi-author/src/services/authorMode.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/extensionService.d.cts +0 -7
- package/dist/packages/minor/doompi-author/src/services/extensionService.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/extensionService.d.mts +0 -7
- package/dist/packages/minor/doompi-author/src/services/extensionService.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/services/extensionService.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/services/extensionService.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/author.d.cts +0 -39
- package/dist/packages/minor/doompi-author/src/types/author.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/author.d.mts +0 -39
- package/dist/packages/minor/doompi-author/src/types/author.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/author.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/types/author.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/authorApi.d.cts +0 -23
- package/dist/packages/minor/doompi-author/src/types/authorApi.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/authorApi.d.mts +0 -23
- package/dist/packages/minor/doompi-author/src/types/authorApi.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/authorApi.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/types/authorApi.mjs.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/extension.d.cts +0 -16
- package/dist/packages/minor/doompi-author/src/types/extension.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/extension.d.mts +0 -16
- package/dist/packages/minor/doompi-author/src/types/extension.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/structuredDocuments.d.cts +0 -60
- package/dist/packages/minor/doompi-author/src/types/structuredDocuments.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/structuredDocuments.d.mts +0 -60
- package/dist/packages/minor/doompi-author/src/types/structuredDocuments.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/webAuthor.d.cts +0 -67
- package/dist/packages/minor/doompi-author/src/types/webAuthor.d.cts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/webAuthor.d.mts +0 -67
- package/dist/packages/minor/doompi-author/src/types/webAuthor.d.mts.map +0 -1
- package/dist/packages/minor/doompi-author/src/types/webAuthor.mjs +0 -2
- package/dist/packages/minor/doompi-author/src/types/webAuthor.mjs.map +0 -1
- package/dist/schemas/authorTools.cjs +0 -2
- package/dist/schemas/authorTools.cjs.map +0 -1
- package/dist/services/authorBridgeState.cjs +0 -2
- package/dist/services/authorBridgeState.cjs.map +0 -1
- package/dist/services/authorMode.cjs +0 -3
- package/dist/services/authorMode.cjs.map +0 -1
- package/dist/services/extensionService.cjs +0 -2
- package/dist/services/extensionService.cjs.map +0 -1
- package/dist/sessionApi.cjs +0 -1
- package/dist/sessionApi.d.cts +0 -7
- package/dist/sessionApi.d.mts +0 -7
- package/dist/sessionApi.mjs +0 -1
- package/dist/types/author.cjs +0 -2
- package/dist/types/author.cjs.map +0 -1
- package/dist/types/authorApi.cjs +0 -2
- package/dist/types/authorApi.cjs.map +0 -1
- package/dist/types/webAuthor.cjs +0 -2
- package/dist/types/webAuthor.cjs.map +0 -1
- package/dist/webHub.cjs +0 -1
- package/dist/webHub.d.cts +0 -2
- package/dist/webHub.d.mts +0 -2
- package/dist/webHub.mjs +0 -1
- package/src/exports/webClient.ts +0 -76
- package/src/web/api/authorBroker.ts +0 -14
- package/src/web/api/authorBrowserBridge.ts +0 -225
- package/src/web/api/authorFiles.ts +0 -219
- package/src/web/api/authorMedia.ts +0 -19
- package/src/web/api/authorRuntime.ts +0 -164
- package/src/web/components/AuthorDocumentPanel.tsx +0 -232
- package/src/web/components/AuthorGridOverlay.tsx +0 -81
- package/src/web/components/AuthorMediaPreview.tsx +0 -41
- package/src/web/components/AuthorMediaView.tsx +0 -356
- package/src/web/components/AuthorPanel.tsx +0 -105
- package/src/web/components/AuthorRegionDrafts.tsx +0 -102
- package/src/web/components/AuthorRequestLog.tsx +0 -179
- package/src/web/components/AuthorStructuredView.tsx +0 -121
- package/src/web/components/AuthorTextView.tsx +0 -97
- package/src/web/components/AuthorToolPalette.tsx +0 -103
- package/src/web/components/AuthorVideoControls.tsx +0 -111
- package/src/web/components/DescribeAuthorToolsToolCard.tsx +0 -50
- package/src/web/components/OpenAuthoringFileToolCard.tsx +0 -66
- package/src/web/components/UseAuthorToolsToolCard.tsx +0 -50
- package/src/web/index.ts +0 -68
- package/src/web/lib/authorGrid.ts +0 -124
- package/src/web/lib/authorRegions.ts +0 -30
- package/src/web/lib/authorViewportTypes.ts +0 -202
- package/src/web/lib/describeAuthorToolsToolRender.ts +0 -20
- package/src/web/lib/useAuthorToolsToolRender.ts +0 -20
- package/src/web/stores/authorCapture.ts +0 -322
- package/src/web/stores/authorGridTools.ts +0 -316
- package/src/web/stores/authorProfiles.ts +0 -130
- package/src/web/stores/authorRequestLifecycle.ts +0 -82
- package/src/web/stores/authorStore.ts +0 -60
- package/src/web/stores/authorWorkspaceStore.ts +0 -525
- package/src/web/tsconfig.json +0 -22
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_structuredDocuments = require("../structuredDocuments-Bg6DIqu5.cjs");
|
|
6
|
+
const require_authorFacade = require("../authorFacade-BvCSzZ5K.cjs");
|
|
7
|
+
const require_authorCommand = require("../authorCommand-Cd5dnLF7.cjs");
|
|
8
|
+
let _agimon_ai_doompi_minor_mode = require("@agimon-ai/doompi-minor-mode");
|
|
9
|
+
let node_crypto = require("node:crypto");
|
|
10
|
+
let node_path = require("node:path");
|
|
11
|
+
node_path = require_structuredDocuments.__toESM(node_path, 1);
|
|
12
|
+
let _agimon_ai_doompi_core_extensionFile = require("@agimon-ai/doompi-core/extensionFile");
|
|
13
|
+
let _agimon_ai_doompi_core_serverFacet = require("@agimon-ai/doompi-core/serverFacet");
|
|
14
|
+
let hono = require("hono");
|
|
15
|
+
let node_fs_promises = require("node:fs/promises");
|
|
16
|
+
node_fs_promises = require_structuredDocuments.__toESM(node_fs_promises, 1);
|
|
17
|
+
let _agimon_ai_doompi_core_web = require("@agimon-ai/doompi-core/web");
|
|
18
|
+
//#region src/services/structuredDocuments/document.ts
|
|
19
|
+
const AUTHOR_DOCUMENT_MAX_BYTES = 26214400;
|
|
20
|
+
async function readDocument(cwd, requestedPath) {
|
|
21
|
+
if (typeof requestedPath !== "string" || requestedPath.length === 0 || requestedPath.includes("\0") || node_path.default.isAbsolute(requestedPath)) throw new Error("A relative document path is required.");
|
|
22
|
+
const root = await node_fs_promises.default.realpath(cwd);
|
|
23
|
+
const candidate = node_path.default.resolve(root, requestedPath);
|
|
24
|
+
if (candidate !== root && !candidate.startsWith(`${root}${node_path.default.sep}`)) throw new Error("Document path is outside the working directory.");
|
|
25
|
+
const realCandidate = await node_fs_promises.default.realpath(candidate);
|
|
26
|
+
if (realCandidate !== root && !realCandidate.startsWith(`${root}${node_path.default.sep}`)) throw new Error("Document path is outside the working directory.");
|
|
27
|
+
if ((await node_fs_promises.default.stat(realCandidate)).size > 26214400) throw new Error(`Document exceeds the ${AUTHOR_DOCUMENT_MAX_BYTES} byte preview limit.`);
|
|
28
|
+
return await node_fs_promises.default.readFile(realCandidate);
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/types/apiRoutes.ts
|
|
32
|
+
/**
|
|
33
|
+
* This package's routes, as data.
|
|
34
|
+
*
|
|
35
|
+
* No scope and no base path. The build reads both off
|
|
36
|
+
* `src/extensions/workspaces/sessions/(backend)/api/author/`, so the mount is
|
|
37
|
+
* stated once, by the folder that creates it. The browser used to restate it:
|
|
38
|
+
* `authorStateUrl` built one URL from `API_BASE_PATH` and the document helper
|
|
39
|
+
* two files away spelled `author` out again as a literal, so the two could
|
|
40
|
+
* disagree and nothing would say so.
|
|
41
|
+
*
|
|
42
|
+
* The order below is the order the three Hono apps register in: `/state` in
|
|
43
|
+
* `authorApi`, the eight bridge routes in `authorBridgeApi`, the three document
|
|
44
|
+
* routes in `authorDocumentApi`. A reviewer can read the two side by side.
|
|
45
|
+
*
|
|
46
|
+
* Response types are named only where a caller reads the body. The bridge
|
|
47
|
+
* routes are called by the hub's author channel over `requestSessionApi`, which
|
|
48
|
+
* has its own message vocabulary and never sees this client.
|
|
49
|
+
*/
|
|
50
|
+
var apiRoutes_default = (0, _agimon_ai_doompi_core_web.defineApiRoutes)({
|
|
51
|
+
state: {
|
|
52
|
+
method: "GET",
|
|
53
|
+
path: "/state",
|
|
54
|
+
response: (0, _agimon_ai_doompi_core_web.apiResponse)()
|
|
55
|
+
},
|
|
56
|
+
bridgeRegister: {
|
|
57
|
+
method: "POST",
|
|
58
|
+
path: "/bridge/register"
|
|
59
|
+
},
|
|
60
|
+
bridgeCatalog: {
|
|
61
|
+
method: "POST",
|
|
62
|
+
path: "/bridge/catalog"
|
|
63
|
+
},
|
|
64
|
+
/** Long-polls for the next capability request, so it settles when one arrives. */
|
|
65
|
+
bridgeNext: {
|
|
66
|
+
method: "POST",
|
|
67
|
+
path: "/bridge/next"
|
|
68
|
+
},
|
|
69
|
+
bridgeResult: {
|
|
70
|
+
method: "POST",
|
|
71
|
+
path: "/bridge/result"
|
|
72
|
+
},
|
|
73
|
+
bridgeCancelled: {
|
|
74
|
+
method: "POST",
|
|
75
|
+
path: "/bridge/cancelled"
|
|
76
|
+
},
|
|
77
|
+
bridgeDisconnect: {
|
|
78
|
+
method: "POST",
|
|
79
|
+
path: "/bridge/disconnect"
|
|
80
|
+
},
|
|
81
|
+
bridgeDescribe: {
|
|
82
|
+
method: "GET",
|
|
83
|
+
path: "/bridge/describe"
|
|
84
|
+
},
|
|
85
|
+
bridgeInvoke: {
|
|
86
|
+
method: "POST",
|
|
87
|
+
path: "/bridge/invoke"
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Parses one structured document.
|
|
91
|
+
*
|
|
92
|
+
* Answers a byte-length summary instead when the request names no format,
|
|
93
|
+
* which is the agent-side tool path; the page always names one.
|
|
94
|
+
*/
|
|
95
|
+
documentsOpen: {
|
|
96
|
+
method: "POST",
|
|
97
|
+
path: "/documents/open",
|
|
98
|
+
query: ["session"],
|
|
99
|
+
response: (0, _agimon_ai_doompi_core_web.apiResponse)()
|
|
100
|
+
},
|
|
101
|
+
documentsPreflight: {
|
|
102
|
+
method: "POST",
|
|
103
|
+
path: "/documents/preflight",
|
|
104
|
+
query: ["session"],
|
|
105
|
+
response: (0, _agimon_ai_doompi_core_web.apiResponse)()
|
|
106
|
+
},
|
|
107
|
+
documentsSerialize: {
|
|
108
|
+
method: "POST",
|
|
109
|
+
path: "/documents/serialize",
|
|
110
|
+
query: ["session"],
|
|
111
|
+
response: (0, _agimon_ai_doompi_core_web.apiResponse)()
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* The host's own bytes route, not this package's.
|
|
115
|
+
*
|
|
116
|
+
* `host: true` hangs it off the session root rather than under `/plugins`,
|
|
117
|
+
* which is how the cockpit already serves it. Author reads a document's
|
|
118
|
+
* bytes and its digest through it, and writes the edited bytes back to the
|
|
119
|
+
* same path, so both stay raw transfers rather than calls: the body is the
|
|
120
|
+
* file and the digest travels in a header.
|
|
121
|
+
*/
|
|
122
|
+
file: {
|
|
123
|
+
method: "GET",
|
|
124
|
+
path: "/file",
|
|
125
|
+
query: ["path"],
|
|
126
|
+
host: true
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/types/authorApi.ts
|
|
131
|
+
/**
|
|
132
|
+
* The wire vocabulary this package's API shares with whatever calls it.
|
|
133
|
+
*
|
|
134
|
+
* Paths live in `./apiRoutes`, which the Hono apps register from and the
|
|
135
|
+
* generated client addresses, so neither half can move alone. What stays here
|
|
136
|
+
* is the mount segment the server registers under and the shape the state
|
|
137
|
+
* route answers with.
|
|
138
|
+
*/
|
|
139
|
+
/** Where a host mounts this package's API; the segment after /api/plugins/. */
|
|
140
|
+
const API_BASE_PATH = "author";
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/extensions/workspaces/sessions/(backend)/api/author/_lib/authorBridgeApi.ts
|
|
143
|
+
function record(value) {
|
|
144
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new require_structuredDocuments.AuthorBridgeError("Invalid request.", 400);
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
function text(value, key) {
|
|
148
|
+
const result = record(value)[key];
|
|
149
|
+
if (typeof result !== "string" || result === "") throw new require_structuredDocuments.AuthorBridgeError(`Invalid ${key}.`, 400);
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
function generation(value) {
|
|
153
|
+
const result = record(value).generation;
|
|
154
|
+
if (!Number.isSafeInteger(result) || result < 0) throw new require_structuredDocuments.AuthorBridgeError("Invalid generation.", 400);
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
async function body(request) {
|
|
158
|
+
return record(await request.json());
|
|
159
|
+
}
|
|
160
|
+
function createAuthorBridgeApi(state) {
|
|
161
|
+
const app = new hono.Hono();
|
|
162
|
+
app.onError((error, context) => context.json({ error: error instanceof Error ? error.message : String(error) }, error instanceof require_structuredDocuments.AuthorBridgeError ? error.status : 500));
|
|
163
|
+
app.post(apiRoutes_default.bridgeRegister.path, async (context) => {
|
|
164
|
+
const value = await body(context.req.raw);
|
|
165
|
+
return context.json(state.register(text(value, "bindingId"), generation(value)));
|
|
166
|
+
});
|
|
167
|
+
app.post(apiRoutes_default.bridgeCatalog.path, async (context) => {
|
|
168
|
+
const value = await body(context.req.raw);
|
|
169
|
+
const tools = value.tools;
|
|
170
|
+
if (!Array.isArray(tools)) throw new require_structuredDocuments.AuthorBridgeError("Invalid Author catalog.", 400);
|
|
171
|
+
return context.json(state.catalog(text(value, "bindingId"), generation(value), text(value, "ownerToken"), tools));
|
|
172
|
+
});
|
|
173
|
+
app.post(apiRoutes_default.bridgeNext.path, async (context) => {
|
|
174
|
+
const value = await body(context.req.raw);
|
|
175
|
+
return context.json(await state.next(text(value, "bindingId"), generation(value), text(value, "ownerToken"), context.req.raw.signal));
|
|
176
|
+
});
|
|
177
|
+
app.post(apiRoutes_default.bridgeResult.path, async (context) => {
|
|
178
|
+
const value = await body(context.req.raw);
|
|
179
|
+
state.result(text(value, "bindingId"), generation(value), text(value, "ownerToken"), text(value, "catalogToken"), text(value, "requestId"), value.result);
|
|
180
|
+
return context.json({ accepted: true });
|
|
181
|
+
});
|
|
182
|
+
app.post(apiRoutes_default.bridgeCancelled.path, async (context) => {
|
|
183
|
+
const value = await body(context.req.raw);
|
|
184
|
+
state.cancelled(text(value, "bindingId"), generation(value), text(value, "ownerToken"), text(value, "catalogToken"), text(value, "requestId"));
|
|
185
|
+
return context.json({ accepted: true });
|
|
186
|
+
});
|
|
187
|
+
app.post(apiRoutes_default.bridgeDisconnect.path, async (context) => {
|
|
188
|
+
const value = await body(context.req.raw);
|
|
189
|
+
state.disconnect(text(value, "bindingId"), generation(value));
|
|
190
|
+
return context.json({ accepted: true });
|
|
191
|
+
});
|
|
192
|
+
app.get(apiRoutes_default.bridgeDescribe.path, (context) => context.json(state.describe()));
|
|
193
|
+
app.post(apiRoutes_default.bridgeInvoke.path, async (context) => {
|
|
194
|
+
const value = require_authorCommand.parseUseAuthorToolInput(await context.req.raw.json());
|
|
195
|
+
return context.json(await state.invoke(value, context.req.raw.signal));
|
|
196
|
+
});
|
|
197
|
+
return app;
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/extensions/workspaces/sessions/(backend)/api/author/_lib/authorDocumentApi.ts
|
|
201
|
+
const FORMATS = /* @__PURE__ */ new Set([
|
|
202
|
+
"markdown-slides",
|
|
203
|
+
"csv",
|
|
204
|
+
"pptx",
|
|
205
|
+
"xlsx"
|
|
206
|
+
]);
|
|
207
|
+
function errorResponse(context, error) {
|
|
208
|
+
const message = error instanceof Error ? error.message : "Document operation failed.";
|
|
209
|
+
const status = /limit|too many|exceeds/i.test(message) ? 413 : /outside/i.test(message) ? 403 : 422;
|
|
210
|
+
return context.json({ error: message }, status);
|
|
211
|
+
}
|
|
212
|
+
function requestFormat(value) {
|
|
213
|
+
if (typeof value !== "string" || !FORMATS.has(value)) throw new Error("A supported format is required.");
|
|
214
|
+
return value;
|
|
215
|
+
}
|
|
216
|
+
function requestOperations(value) {
|
|
217
|
+
if (value === void 0) return [];
|
|
218
|
+
if (!Array.isArray(value) || value.length > 1e5) throw new Error("A bounded operations array is required.");
|
|
219
|
+
return value.map((operation) => {
|
|
220
|
+
if (typeof operation !== "object" || operation === null || typeof operation.fragmentId !== "string" || typeof operation.replacement !== "string") throw new Error("Each operation requires string fragmentId and replacement fields.");
|
|
221
|
+
return operation;
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
async function bodyOf(request) {
|
|
225
|
+
const body = await request.json();
|
|
226
|
+
if (typeof body !== "object" || body === null || Array.isArray(body)) throw new Error("A JSON object is required.");
|
|
227
|
+
return body;
|
|
228
|
+
}
|
|
229
|
+
function createAuthorDocumentApi(options = {}) {
|
|
230
|
+
const app = new hono.Hono();
|
|
231
|
+
const cwd = options.cwd ?? process.cwd();
|
|
232
|
+
app.post(apiRoutes_default.documentsOpen.path, async (context) => {
|
|
233
|
+
try {
|
|
234
|
+
const body = await bodyOf(context.req.raw);
|
|
235
|
+
const bytes = await readDocument(cwd, body.path);
|
|
236
|
+
if (body.format === void 0) return context.json({
|
|
237
|
+
path: body.path,
|
|
238
|
+
byteLength: bytes.byteLength
|
|
239
|
+
});
|
|
240
|
+
return context.json(await require_structuredDocuments.parseStructuredDocument(requestFormat(body.format), bytes, body.csvDialect));
|
|
241
|
+
} catch (error) {
|
|
242
|
+
return errorResponse(context, error);
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
app.post(apiRoutes_default.documentsPreflight.path, async (context) => {
|
|
246
|
+
try {
|
|
247
|
+
const body = await bodyOf(context.req.raw);
|
|
248
|
+
const bytes = await readDocument(cwd, body.path);
|
|
249
|
+
return context.json(await require_structuredDocuments.preflightStructuredDocument(requestFormat(body.format), bytes, requestOperations(body.operations), body.csvDialect));
|
|
250
|
+
} catch (error) {
|
|
251
|
+
return errorResponse(context, error);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
app.post(apiRoutes_default.documentsSerialize.path, async (context) => {
|
|
255
|
+
try {
|
|
256
|
+
const body = await bodyOf(context.req.raw);
|
|
257
|
+
if (typeof body.preflightDigest !== "string") throw new Error("A preflight report digest is required.");
|
|
258
|
+
const bytes = await readDocument(cwd, body.path);
|
|
259
|
+
const serialized = await require_structuredDocuments.serializeStructuredDocument(requestFormat(body.format), bytes, requestOperations(body.operations), body.preflightDigest, body.csvDialect);
|
|
260
|
+
return context.json({
|
|
261
|
+
bytes: Buffer.from(serialized.bytes).toString("base64"),
|
|
262
|
+
encoding: "base64",
|
|
263
|
+
manifest: serialized.manifest,
|
|
264
|
+
operationLog: serialized.operationLog
|
|
265
|
+
});
|
|
266
|
+
} catch (error) {
|
|
267
|
+
return errorResponse(context, error);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
return app;
|
|
271
|
+
}
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/extensions/workspaces/sessions/(backend)/api/author/_lib/authorApi.ts
|
|
274
|
+
const inactiveState = () => ({
|
|
275
|
+
activation: "inactive",
|
|
276
|
+
capabilityCount: 0
|
|
277
|
+
});
|
|
278
|
+
const createBridge = () => require_structuredDocuments.createAuthorBridgeState({
|
|
279
|
+
now: Date.now,
|
|
280
|
+
issueToken: node_crypto.randomUUID,
|
|
281
|
+
scheduleTimeout(callback, delayMs) {
|
|
282
|
+
const timer = setTimeout(callback, delayMs);
|
|
283
|
+
timer.unref?.();
|
|
284
|
+
return () => clearTimeout(timer);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
function createAuthorApi(options = {}) {
|
|
288
|
+
const app = new hono.Hono();
|
|
289
|
+
const bridge = options.bridge ?? createBridge();
|
|
290
|
+
app.get(apiRoutes_default.state.path, (context) => context.json({
|
|
291
|
+
sessionId: options.sessionId ?? null,
|
|
292
|
+
...(options.readState ?? inactiveState)()
|
|
293
|
+
}));
|
|
294
|
+
app.route("/", createAuthorBridgeApi(bridge));
|
|
295
|
+
app.route("/", createAuthorDocumentApi(options.cwd === void 0 ? {} : { cwd: options.cwd }));
|
|
296
|
+
return app;
|
|
297
|
+
}
|
|
298
|
+
const api = {
|
|
299
|
+
basePath: API_BASE_PATH,
|
|
300
|
+
start(context) {
|
|
301
|
+
const bridge = createBridge();
|
|
302
|
+
const app = createAuthorApi({
|
|
303
|
+
...context.sessionId === void 0 ? {} : { sessionId: context.sessionId },
|
|
304
|
+
...context.cwd === void 0 ? {} : { cwd: context.cwd },
|
|
305
|
+
bridge
|
|
306
|
+
});
|
|
307
|
+
return {
|
|
308
|
+
fetch: (request) => app.fetch(request),
|
|
309
|
+
close: () => bridge.close()
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
/** The session API and tools share the same browser ownership and pending requests. */
|
|
314
|
+
function createAuthorSessionApi(cwd, sessionId) {
|
|
315
|
+
const bridge = createBridge();
|
|
316
|
+
return {
|
|
317
|
+
catalog: {
|
|
318
|
+
async open(path, signal) {
|
|
319
|
+
signal?.throwIfAborted();
|
|
320
|
+
return {
|
|
321
|
+
path,
|
|
322
|
+
byteLength: (await readDocument(cwd, path)).byteLength
|
|
323
|
+
};
|
|
324
|
+
},
|
|
325
|
+
async describe(signal) {
|
|
326
|
+
signal?.throwIfAborted();
|
|
327
|
+
return bridge.describe();
|
|
328
|
+
},
|
|
329
|
+
execute: (input, signal) => bridge.invoke(input, signal)
|
|
330
|
+
},
|
|
331
|
+
api: {
|
|
332
|
+
basePath: API_BASE_PATH,
|
|
333
|
+
start() {
|
|
334
|
+
const app = createAuthorApi({
|
|
335
|
+
cwd,
|
|
336
|
+
sessionId,
|
|
337
|
+
bridge
|
|
338
|
+
});
|
|
339
|
+
return {
|
|
340
|
+
fetch: (request) => app.fetch(request),
|
|
341
|
+
close: () => bridge.close()
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
//#endregion
|
|
348
|
+
//#region src/extensions/workspaces/sessions/(backend)/root.server.ts
|
|
349
|
+
var root_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineRoot)(({ agent }) => {
|
|
350
|
+
const session = agent ? createAuthorSessionApi(agent.context.cwd, agent.context.sessionId) : void 0;
|
|
351
|
+
const mode = agent ? require_authorCommand.authorMinorMode.createOwner({
|
|
352
|
+
isActive: () => (agent.context.selection.state?.["minor-mode"] ?? []).includes(require_authorCommand.authorMinorMode.descriptor.id),
|
|
353
|
+
detail: () => "document authoring available",
|
|
354
|
+
async setActive(enabled) {
|
|
355
|
+
const modes = (agent.context.selection.state?.["minor-mode"] ?? []).filter((id) => id !== require_authorCommand.authorMinorMode.descriptor.id);
|
|
356
|
+
await agent.changeSelection({
|
|
357
|
+
axis: "state",
|
|
358
|
+
key: "minor-mode",
|
|
359
|
+
values: enabled ? [...modes, require_authorCommand.authorMinorMode.descriptor.id] : modes
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}) : void 0;
|
|
363
|
+
return {
|
|
364
|
+
value: {
|
|
365
|
+
api: session?.api ?? api,
|
|
366
|
+
catalog: require_authorCommand.createAuthorCatalog(session?.catalog),
|
|
367
|
+
assertAvailable: () => void 0,
|
|
368
|
+
service: void 0
|
|
369
|
+
},
|
|
370
|
+
services: mode ? [(0, _agimon_ai_doompi_minor_mode.serverMinorModes)([mode])] : []
|
|
371
|
+
};
|
|
372
|
+
});
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/types/webAuthor.ts
|
|
375
|
+
const authorChannelType = "author_webmcp";
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/services/webAuthorChannel/index.ts
|
|
378
|
+
/**
|
|
379
|
+
* Which route carries each message the browser sends.
|
|
380
|
+
*
|
|
381
|
+
* The paths come from the package's one route table, so the hub cannot address
|
|
382
|
+
* a bridge route the session no longer serves. `release` is absent because it
|
|
383
|
+
* is answered by the disconnect route rather than one of its own.
|
|
384
|
+
*/
|
|
385
|
+
const BRIDGE_ROUTE = {
|
|
386
|
+
register: apiRoutes_default.bridgeRegister.path,
|
|
387
|
+
catalog: apiRoutes_default.bridgeCatalog.path,
|
|
388
|
+
result: apiRoutes_default.bridgeResult.path,
|
|
389
|
+
cancelled: apiRoutes_default.bridgeCancelled.path
|
|
390
|
+
};
|
|
391
|
+
function isRecord(value) {
|
|
392
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
393
|
+
}
|
|
394
|
+
function browserMessage(value) {
|
|
395
|
+
if (!isRecord(value) || typeof value.kind !== "string") return void 0;
|
|
396
|
+
if (![
|
|
397
|
+
"register",
|
|
398
|
+
"release",
|
|
399
|
+
"catalog",
|
|
400
|
+
"result",
|
|
401
|
+
"cancelled"
|
|
402
|
+
].includes(value.kind)) return void 0;
|
|
403
|
+
return value;
|
|
404
|
+
}
|
|
405
|
+
async function responsePayload(response) {
|
|
406
|
+
const value = await response.json();
|
|
407
|
+
if (response.ok) return value;
|
|
408
|
+
return {
|
|
409
|
+
kind: "rejected",
|
|
410
|
+
reason: isRecord(value) && typeof value.error === "string" ? value.error : `Author bridge HTTP ${response.status}`
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function createAuthorChannel() {
|
|
414
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
415
|
+
let host;
|
|
416
|
+
let closed = false;
|
|
417
|
+
const keyOf = (sessionId, connectionId) => `${sessionId}\0${connectionId}`;
|
|
418
|
+
const send = async (scope, path, value, signal) => await host.requestSessionApi(scope, {
|
|
419
|
+
basePath: API_BASE_PATH,
|
|
420
|
+
path,
|
|
421
|
+
method: "POST",
|
|
422
|
+
body: JSON.stringify(value),
|
|
423
|
+
...signal === void 0 ? {} : { signal }
|
|
424
|
+
});
|
|
425
|
+
const publish = (binding, payload) => host?.publishToConnection?.(binding.connectionId, binding.scope.sessionId, payload) ?? false;
|
|
426
|
+
const poll = async (binding) => {
|
|
427
|
+
binding.poll?.abort();
|
|
428
|
+
const controller = new AbortController();
|
|
429
|
+
binding.poll = controller;
|
|
430
|
+
while (!closed && bindings.get(keyOf(binding.scope.sessionId, binding.connectionId)) === binding) try {
|
|
431
|
+
const payload = await responsePayload(await send(binding.scope, apiRoutes_default.bridgeNext.path, {
|
|
432
|
+
bindingId: binding.connectionId,
|
|
433
|
+
generation: binding.generation,
|
|
434
|
+
ownerToken: binding.ownerToken
|
|
435
|
+
}, controller.signal));
|
|
436
|
+
if (!publish(binding, payload) || payload.kind === "rejected") break;
|
|
437
|
+
} catch (error) {
|
|
438
|
+
if (!controller.signal.aborted) host?.onNotice(error instanceof Error ? error.message : String(error));
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
return {
|
|
443
|
+
frameType: authorChannelType,
|
|
444
|
+
lifecycle: "hub",
|
|
445
|
+
receiveWithoutSubscription: true,
|
|
446
|
+
start(channelHost) {
|
|
447
|
+
host = channelHost;
|
|
448
|
+
return {
|
|
449
|
+
payloadFor: () => void 0,
|
|
450
|
+
sessionRemoved(sessionId) {
|
|
451
|
+
for (const [key, binding] of bindings) {
|
|
452
|
+
if (binding.scope.sessionId !== sessionId) continue;
|
|
453
|
+
binding.poll?.abort();
|
|
454
|
+
bindings.delete(key);
|
|
455
|
+
send(binding.scope, apiRoutes_default.bridgeDisconnect.path, {
|
|
456
|
+
bindingId: binding.connectionId,
|
|
457
|
+
generation: binding.generation
|
|
458
|
+
}).catch((error) => host?.onNotice(error instanceof Error ? error.message : String(error)));
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
close() {
|
|
462
|
+
closed = true;
|
|
463
|
+
for (const binding of bindings.values()) {
|
|
464
|
+
binding.poll?.abort();
|
|
465
|
+
send(binding.scope, apiRoutes_default.bridgeDisconnect.path, {
|
|
466
|
+
bindingId: binding.connectionId,
|
|
467
|
+
generation: binding.generation
|
|
468
|
+
}).catch((error) => host?.onNotice(error instanceof Error ? error.message : String(error)));
|
|
469
|
+
}
|
|
470
|
+
bindings.clear();
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
},
|
|
474
|
+
receive(scope, payload, connection) {
|
|
475
|
+
const message = browserMessage(payload);
|
|
476
|
+
if (message === void 0 || host === void 0 || closed) return;
|
|
477
|
+
(async () => {
|
|
478
|
+
const key = keyOf(scope.sessionId, connection.connectionId);
|
|
479
|
+
const previous = bindings.get(key);
|
|
480
|
+
if (message.kind === "release") {
|
|
481
|
+
if (previous === void 0 || previous.generation !== message.generation) return;
|
|
482
|
+
previous.poll?.abort();
|
|
483
|
+
bindings.delete(key);
|
|
484
|
+
await send(scope, apiRoutes_default.bridgeDisconnect.path, {
|
|
485
|
+
bindingId: connection.connectionId,
|
|
486
|
+
generation: message.generation
|
|
487
|
+
});
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const route = BRIDGE_ROUTE[message.kind];
|
|
491
|
+
const reply = await responsePayload(await send(scope, route, {
|
|
492
|
+
...message,
|
|
493
|
+
bindingId: connection.connectionId
|
|
494
|
+
}));
|
|
495
|
+
if (reply.kind === "accepted") {
|
|
496
|
+
const binding = {
|
|
497
|
+
scope,
|
|
498
|
+
connectionId: connection.connectionId,
|
|
499
|
+
generation: reply.generation,
|
|
500
|
+
ownerToken: reply.ownerToken
|
|
501
|
+
};
|
|
502
|
+
previous?.poll?.abort();
|
|
503
|
+
bindings.set(key, binding);
|
|
504
|
+
publish(binding, reply);
|
|
505
|
+
poll(binding);
|
|
506
|
+
} else if (reply.kind === "rejected" && previous !== void 0) publish(previous, reply);
|
|
507
|
+
})().catch((error) => host?.onNotice(error instanceof Error ? error.message : String(error)));
|
|
508
|
+
},
|
|
509
|
+
disconnected(connection) {
|
|
510
|
+
for (const [key, binding] of bindings) {
|
|
511
|
+
if (binding.connectionId !== connection.connectionId) continue;
|
|
512
|
+
binding.poll?.abort();
|
|
513
|
+
bindings.delete(key);
|
|
514
|
+
send(binding.scope, apiRoutes_default.bridgeDisconnect.path, {
|
|
515
|
+
bindingId: binding.connectionId,
|
|
516
|
+
generation: binding.generation
|
|
517
|
+
}).catch((error) => host?.onNotice(error instanceof Error ? error.message : String(error)));
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/extensions/(backend)/channel/author-webmcp.server.ts
|
|
524
|
+
var author_webmcp_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineChannel)(createAuthorChannel);
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region src/services/authorBridgeMethod/index.ts
|
|
527
|
+
function createAuthorBridgeMethod(scope, host) {
|
|
528
|
+
return (0, _agimon_ai_doompi_core_serverFacet.defineServerMethod)(require_authorFacade.authorBridgeMethod(scope), ({ sessionId, message }, caller) => {
|
|
529
|
+
if (!caller.connectionId) throw new Error("Author bridge requires an authenticated browser connection.");
|
|
530
|
+
if (!host.context.receiveChannel?.(sessionId, "author_webmcp", message, caller.connectionId)) throw new Error("Author bridge session is outside this mount.");
|
|
531
|
+
return {};
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region src/extensions/(backend)/method/bridge.server.ts
|
|
536
|
+
var bridge_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineMethod)(({ host }) => host.scope === "session" ? { register: () => ({ dispose: () => void 0 }) } : createAuthorBridgeMethod(host.scope, host));
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region src/extensions/workspaces/sessions/(backend)/api/author/route.server.ts
|
|
539
|
+
var route_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineRoute)((context) => context.root.api);
|
|
540
|
+
//#endregion
|
|
541
|
+
//#region src/extensions/workspaces/sessions/(backend)/command/author.server.ts
|
|
542
|
+
var author_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineCommand)((context) => require_authorCommand.createAuthorCommand(context.root.service));
|
|
543
|
+
//#endregion
|
|
544
|
+
//#region src/extensions/workspaces/sessions/(backend)/hook/before-agent-start.server.ts
|
|
545
|
+
var before_agent_start_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineHook)({
|
|
546
|
+
when: {
|
|
547
|
+
state: { "minor-mode": "author" },
|
|
548
|
+
attribution: {
|
|
549
|
+
kind: "minor",
|
|
550
|
+
mode: "author"
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
event: "before_agent_start",
|
|
554
|
+
handle(event) {
|
|
555
|
+
return { systemPrompt: `${typeof event.systemPrompt === "string" ? event.systemPrompt : ""}\n\n${require_authorCommand.AUTHOR_GUIDANCE}`.trim() };
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region src/extensions/workspaces/sessions/(backend)/resource/doompi-use-author.server.ts
|
|
560
|
+
var doompi_use_author_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineResource)({
|
|
561
|
+
when: {
|
|
562
|
+
state: { "minor-mode": "author" },
|
|
563
|
+
attribution: {
|
|
564
|
+
kind: "minor",
|
|
565
|
+
mode: "author"
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
name: "doompi-use-author",
|
|
569
|
+
kind: "skill",
|
|
570
|
+
read: () => (0, _agimon_ai_doompi_core_serverFacet.readPackageResource)(require("url").pathToFileURL(__filename).href, "src/prompts/doompi-use-author/SKILL.md")
|
|
571
|
+
});
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region src/extensions/workspaces/sessions/(backend)/tool/describe-author-tools.server.ts
|
|
574
|
+
var describe_author_tools_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineTool)((context) => ({
|
|
575
|
+
...require_authorCommand.createAuthorTools(context.root.catalog, context.root.assertAvailable)[1],
|
|
576
|
+
when: require_authorCommand.AUTHOR_TOOL_WHEN
|
|
577
|
+
}));
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/extensions/workspaces/sessions/(backend)/tool/open-authoring-file.server.ts
|
|
580
|
+
var open_authoring_file_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineTool)((context) => ({
|
|
581
|
+
...require_authorCommand.createAuthorTools(context.root.catalog, context.root.assertAvailable)[0],
|
|
582
|
+
when: require_authorCommand.AUTHOR_TOOL_WHEN
|
|
583
|
+
}));
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region src/extensions/workspaces/sessions/(backend)/tool/use-author-tools.server.ts
|
|
586
|
+
var use_author_tools_server_default = (0, _agimon_ai_doompi_core_extensionFile.defineTool)((context) => ({
|
|
587
|
+
...require_authorCommand.createAuthorTools(context.root.catalog, context.root.assertAvailable)[2],
|
|
588
|
+
when: require_authorCommand.AUTHOR_TOOL_WHEN
|
|
589
|
+
}));
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region generated/server.ts
|
|
592
|
+
const at = (value, context) => typeof value === "function" ? value(context) : value;
|
|
593
|
+
const via = (identity, value) => ({
|
|
594
|
+
...identity,
|
|
595
|
+
...value
|
|
596
|
+
});
|
|
597
|
+
const facet = (0, _agimon_ai_doompi_core_serverFacet.defineServerPlugin)({
|
|
598
|
+
name: "@agimon-ai/doompi-author",
|
|
599
|
+
global: (context) => ({
|
|
600
|
+
get channels() {
|
|
601
|
+
return [() => via({ frameType: "author_webmcp" }, author_webmcp_server_default())];
|
|
602
|
+
},
|
|
603
|
+
get methods() {
|
|
604
|
+
return [at(bridge_server_default, context)];
|
|
605
|
+
}
|
|
606
|
+
}),
|
|
607
|
+
workspace: (context) => ({
|
|
608
|
+
get channels() {
|
|
609
|
+
return [() => via({ frameType: "author_webmcp" }, author_webmcp_server_default())];
|
|
610
|
+
},
|
|
611
|
+
get methods() {
|
|
612
|
+
return [at(bridge_server_default, context)];
|
|
613
|
+
}
|
|
614
|
+
}),
|
|
615
|
+
session: async (context) => {
|
|
616
|
+
const scopeSession = await root_server_default(context);
|
|
617
|
+
const contextSession = {
|
|
618
|
+
...context,
|
|
619
|
+
root: scopeSession.value
|
|
620
|
+
};
|
|
621
|
+
return {
|
|
622
|
+
...(0, _agimon_ai_doompi_core_extensionFile.composeRootHooks)(scopeSession),
|
|
623
|
+
get api() {
|
|
624
|
+
return [at(route_server_default, contextSession)];
|
|
625
|
+
},
|
|
626
|
+
get channels() {
|
|
627
|
+
return [() => via({ frameType: "author_webmcp" }, author_webmcp_server_default())];
|
|
628
|
+
},
|
|
629
|
+
get commands() {
|
|
630
|
+
return [via({ name: "author" }, at(author_server_default, contextSession))];
|
|
631
|
+
},
|
|
632
|
+
get hooks() {
|
|
633
|
+
return [via({ event: "before_agent_start" }, at(before_agent_start_server_default, contextSession))];
|
|
634
|
+
},
|
|
635
|
+
get methods() {
|
|
636
|
+
return [at(bridge_server_default, context)];
|
|
637
|
+
},
|
|
638
|
+
get resources() {
|
|
639
|
+
return [at(doompi_use_author_server_default, contextSession)];
|
|
640
|
+
},
|
|
641
|
+
get tools() {
|
|
642
|
+
return [
|
|
643
|
+
via({ name: "describe_author_tools" }, at(describe_author_tools_server_default, contextSession)),
|
|
644
|
+
via({ name: "open_authoring_file" }, at(open_authoring_file_server_default, contextSession)),
|
|
645
|
+
via({ name: "use_author_tools" }, at(use_author_tools_server_default, contextSession))
|
|
646
|
+
];
|
|
647
|
+
},
|
|
648
|
+
services: [...scopeSession.services ?? []],
|
|
649
|
+
get activities() {
|
|
650
|
+
return [...scopeSession.activities ?? []];
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
//#endregion
|
|
656
|
+
exports.default = facet;
|
|
657
|
+
exports.facet = facet;
|
|
658
|
+
|
|
659
|
+
//# sourceMappingURL=server.cjs.map
|