@dinoxx/dinox-cli 2.18.5 → 2.20.0
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/LICENSE +15 -0
- package/README.md +17 -17
- package/dist/chunks/applePodcast-V4FSJOC5.js +169 -0
- package/dist/chunks/bbc-NTMRPYRF.js +570 -0
- package/dist/chunks/bilibili-UA3MBSPH.js +835 -0
- package/dist/chunks/bohaishibei-B7UVXH4Y.js +246 -0
- package/dist/chunks/chunk-224ML7QC.js +21 -0
- package/dist/chunks/chunk-2LW76QIL.js +32 -0
- package/dist/chunks/chunk-2M7RJATW.js +60 -0
- package/dist/chunks/chunk-3EKNTO6G.js +61 -0
- package/dist/chunks/chunk-3VZNZWDG.js +437 -0
- package/dist/chunks/chunk-5JF7J5MP.js +114 -0
- package/dist/chunks/chunk-5KU25TMX.js +26 -0
- package/dist/chunks/chunk-67RXND3H.js +65 -0
- package/dist/chunks/chunk-6AZT4ARG.js +1491 -0
- package/dist/chunks/chunk-6D3QLMRM.js +421 -0
- package/dist/chunks/chunk-6VMHHE5Y.js +235 -0
- package/dist/chunks/chunk-77UP745T.js +143 -0
- package/dist/chunks/chunk-7A5QISPG.js +19 -0
- package/dist/chunks/chunk-7ODU7LXP.js +31 -0
- package/dist/chunks/chunk-A6WF7CZL.js +904 -0
- package/dist/chunks/chunk-ABYPGMDC.js +100 -0
- package/dist/chunks/chunk-AHRCI2RW.js +141 -0
- package/dist/chunks/chunk-BDLS5EEP.js +49 -0
- package/dist/chunks/chunk-BKCNERPB.js +246 -0
- package/dist/chunks/chunk-BZQYECIH.js +54 -0
- package/dist/chunks/chunk-D5SBKLDX.js +71 -0
- package/dist/chunks/chunk-DR6BGSZM.js +865 -0
- package/dist/chunks/chunk-F7BDWXBG.js +57 -0
- package/dist/chunks/chunk-FGQRYB7F.js +34 -0
- package/dist/chunks/chunk-FIQYJ6KZ.js +19 -0
- package/dist/chunks/chunk-FKLZZGEX.js +116 -0
- package/dist/chunks/chunk-FZGEWY5L.js +37 -0
- package/dist/chunks/chunk-GTDX2LIJ.js +265 -0
- package/dist/chunks/chunk-HIJXC3RT.js +194 -0
- package/dist/chunks/chunk-HQJUJYUM.js +36 -0
- package/dist/chunks/chunk-IAEJG5NI.js +50 -0
- package/dist/chunks/chunk-KCHHY6QB.js +65 -0
- package/dist/chunks/chunk-KL75BFYJ.js +71 -0
- package/dist/chunks/chunk-KOAKG2QU.js +45 -0
- package/dist/chunks/chunk-MCFXD2LS.js +66 -0
- package/dist/chunks/chunk-MLOITAK6.js +29 -0
- package/dist/chunks/chunk-N44NRKDJ.js +101 -0
- package/dist/chunks/chunk-N6ALWINB.js +14115 -0
- package/dist/chunks/chunk-NGIIELO4.js +61 -0
- package/dist/chunks/chunk-OG6MBAGC.js +95 -0
- package/dist/chunks/chunk-P4LG4DIO.js +108 -0
- package/dist/chunks/chunk-PJDD4R46.js +77 -0
- package/dist/chunks/chunk-PK5AOVLU.js +107 -0
- package/dist/chunks/chunk-PTFGE4KS.js +66 -0
- package/dist/chunks/chunk-Q6G7VO5G.js +67 -0
- package/dist/chunks/chunk-QFUD3I7W.js +185 -0
- package/dist/chunks/chunk-QNIYFLJT.js +39 -0
- package/dist/chunks/chunk-QZQRG3JY.js +86 -0
- package/dist/chunks/chunk-RKJYKUQD.js +91 -0
- package/dist/chunks/chunk-TAENC45D.js +160 -0
- package/dist/chunks/chunk-TILRKKRN.js +20481 -0
- package/dist/chunks/chunk-TIXOORAP.js +60 -0
- package/dist/chunks/chunk-ULKGDBAJ.js +80 -0
- package/dist/chunks/chunk-URYABAYN.js +72 -0
- package/dist/chunks/chunk-VNB4ZFLN.js +86 -0
- package/dist/chunks/chunk-W7R5JTSA.js +42 -0
- package/dist/chunks/chunk-WC3GSQBC.js +25699 -0
- package/dist/chunks/chunk-WMJXAF3X.js +55 -0
- package/dist/chunks/chunk-X36EIV25.js +93 -0
- package/dist/chunks/chunk-X7IZXCSL.js +60 -0
- package/dist/chunks/chunk-XEPDFQYD.js +215 -0
- package/dist/chunks/chunk-XFVLNCOW.js +171 -0
- package/dist/chunks/chunk-XMMTGPZ6.js +1332 -0
- package/dist/chunks/chunk-XQZUX7OT.js +39 -0
- package/dist/chunks/chunk-XZLFMJOG.js +72 -0
- package/dist/chunks/chunk-ZGF3OEWR.js +84 -0
- package/dist/chunks/chunk-ZHKS4R4P.js +1215 -0
- package/dist/chunks/cookies-6QQHSM26.js +34 -0
- package/dist/chunks/dedaoNote-KJ32ZQLS.js +418 -0
- package/dist/chunks/doubanGroup-HR4K2KMY.js +429 -0
- package/dist/chunks/doubao-MXUHPLUB.js +462 -0
- package/dist/chunks/douyin-UU2FSQPS.js +566 -0
- package/dist/chunks/ensure-MLNCD2SD.js +18 -0
- package/dist/chunks/execute-57M65KKK.js +17 -0
- package/dist/chunks/facebook-SZFOVE7R.js +878 -0
- package/dist/chunks/feishu-ISWRJ7HI.js +877 -0
- package/dist/chunks/ima-D7CX5WR4.js +202 -0
- package/dist/chunks/instagram-HNDPO37H.js +939 -0
- package/dist/chunks/install-IIMVFNAT.js +303 -0
- package/dist/chunks/jike-H7L4LJTN.js +445 -0
- package/dist/chunks/mcp-PZBHAYXQ.js +297 -0
- package/dist/chunks/mcpServer-T4DNYR7R.js +436 -0
- package/dist/chunks/metaso-ZVZW5UBB.js +194 -0
- package/dist/chunks/run-GCMWLTIV.js +1464 -0
- package/dist/chunks/runCli-SBQE2VQJ.js +464 -0
- package/dist/chunks/setup-EEU6GSWX.js +378 -0
- package/dist/chunks/threads-ADW6IANQ.js +657 -0
- package/dist/chunks/twitter-NAGCB3NI.js +1148 -0
- package/dist/chunks/web-QFKZCM4F.js +31 -0
- package/dist/chunks/wechat-OXNNLT4J.js +1551 -0
- package/dist/chunks/weibo-PMVGDNQU.js +641 -0
- package/dist/chunks/workbuddy-NNAXIIIZ.js +426 -0
- package/dist/chunks/xiaoheihe-WFQJRBAD.js +316 -0
- package/dist/chunks/xiaohongshu-5CXBELGW.js +1833 -0
- package/dist/chunks/xiaoyuzhou-6L6IB46Y.js +322 -0
- package/dist/chunks/youtube-52NGBTQC.js +58 -0
- package/dist/chunks/zcool-HDSWK4KD.js +755 -0
- package/dist/chunks/zhihu-EX2VRJYY.js +1024 -0
- package/dist/dinox.js +137 -51
- package/dist/dsh-plugin/lib/client.js +754 -317
- package/dist/dsh-plugin/lib/index.js +7 -2
- package/dist/dsh-plugin/package.json +1 -1
- package/dist/dsh-plugin/runtime.json +3 -3
- package/dist/editor-ui/mcp-app.html +325 -303
- package/package.json +81 -63
- package/dist/ai/ragxClient.d.ts +0 -15
- package/dist/ai/ragxClient.js +0 -71
- package/dist/auth/devicePair.d.ts +0 -62
- package/dist/auth/devicePair.js +0 -377
- package/dist/auth/userInfo.d.ts +0 -26
- package/dist/auth/userInfo.js +0 -224
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -130
- package/dist/cliTypes.d.ts +0 -7
- package/dist/cliTypes.js +0 -1
- package/dist/commands/auth/index.d.ts +0 -34
- package/dist/commands/auth/index.js +0 -605
- package/dist/commands/batch.d.ts +0 -35
- package/dist/commands/batch.js +0 -202
- package/dist/commands/boxes/index.d.ts +0 -4
- package/dist/commands/boxes/index.js +0 -382
- package/dist/commands/boxes/model.d.ts +0 -37
- package/dist/commands/boxes/model.js +0 -93
- package/dist/commands/boxes/operations.d.ts +0 -86
- package/dist/commands/boxes/operations.js +0 -448
- package/dist/commands/boxes/repo.d.ts +0 -36
- package/dist/commands/boxes/repo.js +0 -320
- package/dist/commands/boxes/store.d.ts +0 -22
- package/dist/commands/boxes/store.js +0 -143
- package/dist/commands/config/index.d.ts +0 -5
- package/dist/commands/config/index.js +0 -105
- package/dist/commands/descriptor/register.d.ts +0 -8
- package/dist/commands/descriptor/register.js +0 -122
- package/dist/commands/descriptor/types.d.ts +0 -37
- package/dist/commands/descriptor/types.js +0 -17
- package/dist/commands/doctor.d.ts +0 -126
- package/dist/commands/doctor.js +0 -558
- package/dist/commands/domain/options.d.ts +0 -10
- package/dist/commands/domain/options.js +0 -75
- package/dist/commands/domain/run.d.ts +0 -24
- package/dist/commands/domain/run.js +0 -137
- package/dist/commands/editor/index.d.ts +0 -4
- package/dist/commands/editor/index.js +0 -155
- package/dist/commands/gateway/index.d.ts +0 -4
- package/dist/commands/gateway/index.js +0 -340
- package/dist/commands/graph/index.d.ts +0 -4
- package/dist/commands/graph/index.js +0 -173
- package/dist/commands/graph/repo.d.ts +0 -40
- package/dist/commands/graph/repo.js +0 -201
- package/dist/commands/info/index.d.ts +0 -4
- package/dist/commands/info/index.js +0 -75
- package/dist/commands/mcp.d.ts +0 -6
- package/dist/commands/mcp.js +0 -47
- package/dist/commands/meta/index.d.ts +0 -4
- package/dist/commands/meta/index.js +0 -60
- package/dist/commands/meta/repo.d.ts +0 -30
- package/dist/commands/meta/repo.js +0 -76
- package/dist/commands/notes/actions.d.ts +0 -12
- package/dist/commands/notes/actions.js +0 -591
- package/dist/commands/notes/bulk.d.ts +0 -35
- package/dist/commands/notes/bulk.js +0 -195
- package/dist/commands/notes/contentEngine.d.ts +0 -95
- package/dist/commands/notes/contentEngine.js +0 -710
- package/dist/commands/notes/contentPatch.d.ts +0 -114
- package/dist/commands/notes/contentPatch.js +0 -450
- package/dist/commands/notes/contentPatchCommand.d.ts +0 -6
- package/dist/commands/notes/contentPatchCommand.js +0 -164
- package/dist/commands/notes/createFromTemplate.d.ts +0 -35
- package/dist/commands/notes/createFromTemplate.js +0 -58
- package/dist/commands/notes/descriptors.d.ts +0 -4
- package/dist/commands/notes/descriptors.js +0 -548
- package/dist/commands/notes/detailContent.d.ts +0 -19
- package/dist/commands/notes/detailContent.js +0 -62
- package/dist/commands/notes/dryRun.d.ts +0 -33
- package/dist/commands/notes/dryRun.js +0 -133
- package/dist/commands/notes/export.d.ts +0 -27
- package/dist/commands/notes/export.js +0 -252
- package/dist/commands/notes/index.d.ts +0 -2
- package/dist/commands/notes/index.js +0 -2
- package/dist/commands/notes/metadataMutation.d.ts +0 -29
- package/dist/commands/notes/metadataMutation.js +0 -138
- package/dist/commands/notes/repo/read.d.ts +0 -8
- package/dist/commands/notes/repo/read.js +0 -302
- package/dist/commands/notes/repo/resolve.d.ts +0 -8
- package/dist/commands/notes/repo/resolve.js +0 -187
- package/dist/commands/notes/repo/search.d.ts +0 -43
- package/dist/commands/notes/repo/search.js +0 -513
- package/dist/commands/notes/repo/semantic.d.ts +0 -14
- package/dist/commands/notes/repo/semantic.js +0 -31
- package/dist/commands/notes/repo/shared.d.ts +0 -192
- package/dist/commands/notes/repo/shared.js +0 -102
- package/dist/commands/notes/repo/write.d.ts +0 -27
- package/dist/commands/notes/repo/write.js +0 -262
- package/dist/commands/notes/repo.d.ts +0 -7
- package/dist/commands/notes/repo.js +0 -7
- package/dist/commands/notes/runtime.d.ts +0 -20
- package/dist/commands/notes/runtime.js +0 -175
- package/dist/commands/notes/searchOutput.d.ts +0 -15
- package/dist/commands/notes/searchOutput.js +0 -54
- package/dist/commands/notes/searchResponse.d.ts +0 -54
- package/dist/commands/notes/searchResponse.js +0 -57
- package/dist/commands/notes/searchSql.d.ts +0 -11
- package/dist/commands/notes/searchSql.js +0 -614
- package/dist/commands/notes/searchTime.d.ts +0 -9
- package/dist/commands/notes/searchTime.js +0 -85
- package/dist/commands/notes/semantic.d.ts +0 -116
- package/dist/commands/notes/semantic.js +0 -332
- package/dist/commands/notes/writeReceipt.d.ts +0 -20
- package/dist/commands/notes/writeReceipt.js +0 -82
- package/dist/commands/prompt/index.d.ts +0 -5
- package/dist/commands/prompt/index.js +0 -132
- package/dist/commands/prompt/repo.d.ts +0 -28
- package/dist/commands/prompt/repo.js +0 -220
- package/dist/commands/properties/index.d.ts +0 -16
- package/dist/commands/properties/index.js +0 -640
- package/dist/commands/properties/repo.d.ts +0 -150
- package/dist/commands/properties/repo.js +0 -272
- package/dist/commands/runtime.d.ts +0 -54
- package/dist/commands/runtime.js +0 -228
- package/dist/commands/savedViews/fields.d.ts +0 -28
- package/dist/commands/savedViews/fields.js +0 -87
- package/dist/commands/savedViews/index.d.ts +0 -7
- package/dist/commands/savedViews/index.js +0 -506
- package/dist/commands/savedViews/model.d.ts +0 -45
- package/dist/commands/savedViews/model.js +0 -90
- package/dist/commands/savedViews/repo.d.ts +0 -125
- package/dist/commands/savedViews/repo.js +0 -393
- package/dist/commands/schema/commandMetadata.d.ts +0 -2
- package/dist/commands/schema/commandMetadata.js +0 -18
- package/dist/commands/schema/globalOptions.d.ts +0 -11
- package/dist/commands/schema/globalOptions.js +0 -11
- package/dist/commands/schema/index.d.ts +0 -5
- package/dist/commands/schema/index.js +0 -130
- package/dist/commands/schema/renderSkills.d.ts +0 -12
- package/dist/commands/schema/renderSkills.js +0 -364
- package/dist/commands/schema/spec.d.ts +0 -5
- package/dist/commands/schema/spec.js +0 -74
- package/dist/commands/schema/types.d.ts +0 -34
- package/dist/commands/schema/types.js +0 -1
- package/dist/commands/skills/index.d.ts +0 -80
- package/dist/commands/skills/index.js +0 -572
- package/dist/commands/storage/index.d.ts +0 -4
- package/dist/commands/storage/index.js +0 -270
- package/dist/commands/storage/repo/configs.d.ts +0 -30
- package/dist/commands/storage/repo/configs.js +0 -259
- package/dist/commands/storage/repo/operations.d.ts +0 -25
- package/dist/commands/storage/repo/operations.js +0 -339
- package/dist/commands/storage/repo/remote.d.ts +0 -32
- package/dist/commands/storage/repo/remote.js +0 -132
- package/dist/commands/storage/repo/resources.d.ts +0 -12
- package/dist/commands/storage/repo/resources.js +0 -134
- package/dist/commands/storage/repo/shared.d.ts +0 -181
- package/dist/commands/storage/repo/shared.js +0 -36
- package/dist/commands/storage/repo/targets.d.ts +0 -12
- package/dist/commands/storage/repo/targets.js +0 -178
- package/dist/commands/storage/repo.d.ts +0 -3
- package/dist/commands/storage/repo.js +0 -4
- package/dist/commands/sync.d.ts +0 -27
- package/dist/commands/sync.js +0 -153
- package/dist/commands/tags/content.d.ts +0 -32
- package/dist/commands/tags/content.js +0 -252
- package/dist/commands/tags/index.d.ts +0 -4
- package/dist/commands/tags/index.js +0 -404
- package/dist/commands/tags/model.d.ts +0 -38
- package/dist/commands/tags/model.js +0 -100
- package/dist/commands/tags/operations.d.ts +0 -105
- package/dist/commands/tags/operations.js +0 -468
- package/dist/commands/tags/repo.d.ts +0 -27
- package/dist/commands/tags/repo.js +0 -236
- package/dist/commands/tags/store.d.ts +0 -28
- package/dist/commands/tags/store.js +0 -166
- package/dist/commands/templates/index.d.ts +0 -4
- package/dist/commands/templates/index.js +0 -290
- package/dist/commands/templates/model.d.ts +0 -28
- package/dist/commands/templates/model.js +0 -195
- package/dist/commands/templates/repo.d.ts +0 -53
- package/dist/commands/templates/repo.js +0 -78
- package/dist/commands/todo/contentModel.d.ts +0 -31
- package/dist/commands/todo/contentModel.js +0 -375
- package/dist/commands/todo/dryRun.d.ts +0 -24
- package/dist/commands/todo/dryRun.js +0 -137
- package/dist/commands/todo/index.d.ts +0 -10
- package/dist/commands/todo/index.js +0 -445
- package/dist/commands/todo/repo.d.ts +0 -136
- package/dist/commands/todo/repo.js +0 -428
- package/dist/commands/todo/taskIdentity.d.ts +0 -2
- package/dist/commands/todo/taskIdentity.js +0 -64
- package/dist/commands/todo/taskModel.d.ts +0 -37
- package/dist/commands/todo/taskModel.js +0 -359
- package/dist/commands/update.d.ts +0 -46
- package/dist/commands/update.js +0 -326
- package/dist/commands/writeConfirmation.d.ts +0 -13
- package/dist/commands/writeConfirmation.js +0 -54
- package/dist/commands/writeDryRun.d.ts +0 -88
- package/dist/commands/writeDryRun.js +0 -162
- package/dist/commands/writeDurability.d.ts +0 -5
- package/dist/commands/writeDurability.js +0 -22
- package/dist/commands/writeReceipt.d.ts +0 -13
- package/dist/commands/writeReceipt.js +0 -12
- package/dist/config/keys.d.ts +0 -9
- package/dist/config/keys.js +0 -14
- package/dist/config/paths.d.ts +0 -6
- package/dist/config/paths.js +0 -55
- package/dist/config/resolve.d.ts +0 -4
- package/dist/config/resolve.js +0 -68
- package/dist/config/serviceEndpoints.d.ts +0 -5
- package/dist/config/serviceEndpoints.js +0 -5
- package/dist/config/store.d.ts +0 -8
- package/dist/config/store.js +0 -149
- package/dist/config/types.d.ts +0 -55
- package/dist/config/types.js +0 -1
- package/dist/constants/links.d.ts +0 -18
- package/dist/constants/links.js +0 -26
- package/dist/contract/snapshot.d.ts +0 -30
- package/dist/contract/snapshot.js +0 -114
- package/dist/daemon/autoInstall.d.ts +0 -32
- package/dist/daemon/autoInstall.js +0 -106
- package/dist/daemon/client.d.ts +0 -29
- package/dist/daemon/client.js +0 -418
- package/dist/daemon/connectivity.d.ts +0 -20
- package/dist/daemon/connectivity.js +0 -42
- package/dist/daemon/ensure.d.ts +0 -1
- package/dist/daemon/ensure.js +0 -120
- package/dist/daemon/env.d.ts +0 -8
- package/dist/daemon/env.js +0 -81
- package/dist/daemon/forward.d.ts +0 -37
- package/dist/daemon/forward.js +0 -155
- package/dist/daemon/fresh.d.ts +0 -4
- package/dist/daemon/fresh.js +0 -10
- package/dist/daemon/index.d.ts +0 -80
- package/dist/daemon/index.js +0 -727
- package/dist/daemon/launch.d.ts +0 -43
- package/dist/daemon/launch.js +0 -124
- package/dist/daemon/lifecycle.d.ts +0 -51
- package/dist/daemon/lifecycle.js +0 -182
- package/dist/daemon/log.d.ts +0 -14
- package/dist/daemon/log.js +0 -57
- package/dist/daemon/pid.d.ts +0 -31
- package/dist/daemon/pid.js +0 -212
- package/dist/daemon/route.d.ts +0 -14
- package/dist/daemon/route.js +0 -43
- package/dist/daemon/server.d.ts +0 -67
- package/dist/daemon/server.js +0 -563
- package/dist/daemon/supervise.d.ts +0 -29
- package/dist/daemon/supervise.js +0 -100
- package/dist/daemon/supervisor.d.ts +0 -91
- package/dist/daemon/supervisor.js +0 -612
- package/dist/daemon/types.d.ts +0 -71
- package/dist/daemon/types.js +0 -2
- package/dist/dinox.d.ts +0 -2
- package/dist/editor/anchor.d.ts +0 -46
- package/dist/editor/anchor.js +0 -129
- package/dist/editor/blockIds.d.ts +0 -21
- package/dist/editor/blockIds.js +0 -51
- package/dist/editor/blocks.d.ts +0 -47
- package/dist/editor/blocks.js +0 -236
- package/dist/editor/compat.d.ts +0 -32
- package/dist/editor/compat.js +0 -392
- package/dist/editor/daemon.d.ts +0 -10
- package/dist/editor/daemon.js +0 -56
- package/dist/editor/document.d.ts +0 -74
- package/dist/editor/document.js +0 -88
- package/dist/editor/i18n.d.ts +0 -23
- package/dist/editor/i18n.js +0 -61
- package/dist/editor/install.d.ts +0 -90
- package/dist/editor/install.js +0 -335
- package/dist/editor/mcp.d.ts +0 -22
- package/dist/editor/mcp.js +0 -222
- package/dist/editor/meta.d.ts +0 -70
- package/dist/editor/meta.js +0 -163
- package/dist/editor/paths.d.ts +0 -2
- package/dist/editor/paths.js +0 -13
- package/dist/editor/persistence.d.ts +0 -4
- package/dist/editor/persistence.js +0 -35
- package/dist/editor/saveGuard.d.ts +0 -9
- package/dist/editor/saveGuard.js +0 -38
- package/dist/editor/schema.d.ts +0 -14
- package/dist/editor/schema.js +0 -38
- package/dist/editor/service.d.ts +0 -326
- package/dist/editor/service.js +0 -1007
- package/dist/gateway/adapters/acp.d.ts +0 -75
- package/dist/gateway/adapters/acp.js +0 -431
- package/dist/gateway/adapters/codexImages.d.ts +0 -4
- package/dist/gateway/adapters/codexImages.js +0 -34
- package/dist/gateway/adapters/echo.d.ts +0 -12
- package/dist/gateway/adapters/echo.js +0 -54
- package/dist/gateway/adapters/index.d.ts +0 -13
- package/dist/gateway/adapters/index.js +0 -42
- package/dist/gateway/agentTaskHost.d.ts +0 -135
- package/dist/gateway/agentTaskHost.js +0 -410
- package/dist/gateway/assistantProjection.d.ts +0 -36
- package/dist/gateway/assistantProjection.js +0 -230
- package/dist/gateway/config.d.ts +0 -56
- package/dist/gateway/config.js +0 -312
- package/dist/gateway/conversationContext.d.ts +0 -44
- package/dist/gateway/conversationContext.js +0 -75
- package/dist/gateway/detect.d.ts +0 -63
- package/dist/gateway/detect.js +0 -281
- package/dist/gateway/deviceHost.d.ts +0 -100
- package/dist/gateway/deviceHost.js +0 -735
- package/dist/gateway/fileUpload.d.ts +0 -12
- package/dist/gateway/fileUpload.js +0 -154
- package/dist/gateway/keepAwake.d.ts +0 -24
- package/dist/gateway/keepAwake.js +0 -64
- package/dist/gateway/mcpCommandTools.d.ts +0 -62
- package/dist/gateway/mcpCommandTools.js +0 -220
- package/dist/gateway/mcpEnv.d.ts +0 -11
- package/dist/gateway/mcpEnv.js +0 -11
- package/dist/gateway/mcpGroups.d.ts +0 -3
- package/dist/gateway/mcpGroups.js +0 -4
- package/dist/gateway/mcpServer.d.ts +0 -25
- package/dist/gateway/mcpServer.js +0 -214
- package/dist/gateway/processTree.d.ts +0 -15
- package/dist/gateway/processTree.js +0 -60
- package/dist/gateway/protocol.d.ts +0 -145
- package/dist/gateway/protocol.js +0 -195
- package/dist/gateway/runExecutor.d.ts +0 -104
- package/dist/gateway/runExecutor.js +0 -480
- package/dist/gateway/service.d.ts +0 -35
- package/dist/gateway/service.js +0 -147
- package/dist/gateway/spawnAgent.d.ts +0 -12
- package/dist/gateway/spawnAgent.js +0 -32
- package/dist/gateway/streamPublisher.d.ts +0 -33
- package/dist/gateway/streamPublisher.js +0 -93
- package/dist/gateway/taskJournal.d.ts +0 -14
- package/dist/gateway/taskJournal.js +0 -47
- package/dist/gateway/threadStore.d.ts +0 -230
- package/dist/gateway/threadStore.js +0 -621
- package/dist/gateway/types.d.ts +0 -168
- package/dist/gateway/types.js +0 -12
- package/dist/gateway/workspace.d.ts +0 -5
- package/dist/gateway/workspace.js +0 -30
- package/dist/gateway/workspaceFolders.d.ts +0 -35
- package/dist/gateway/workspaceFolders.js +0 -142
- package/dist/gateway/workspaceListing.d.ts +0 -5
- package/dist/gateway/workspaceListing.js +0 -78
- package/dist/integrations/dsh/host.d.ts +0 -53
- package/dist/integrations/dsh/host.js +0 -237
- package/dist/integrations/dsh/mcpClient.d.ts +0 -66
- package/dist/integrations/dsh/mcpClient.js +0 -192
- package/dist/powersync/connector.d.ts +0 -22
- package/dist/powersync/connector.js +0 -91
- package/dist/powersync/exclusiveRuntime.d.ts +0 -21
- package/dist/powersync/exclusiveRuntime.js +0 -66
- package/dist/powersync/runtime.d.ts +0 -62
- package/dist/powersync/runtime.js +0 -358
- package/dist/powersync/schema/content.d.ts +0 -1
- package/dist/powersync/schema/content.js +0 -1
- package/dist/powersync/schema/electronCanonical.d.ts +0 -1561
- package/dist/powersync/schema/electronCanonical.js +0 -1154
- package/dist/powersync/schema/index.d.ts +0 -844
- package/dist/powersync/schema/index.js +0 -8
- package/dist/powersync/schema/local.d.ts +0 -13
- package/dist/powersync/schema/local.js +0 -24
- package/dist/powersync/schema/note.d.ts +0 -1
- package/dist/powersync/schema/note.js +0 -1
- package/dist/powersync/schema/notesExtras.d.ts +0 -1
- package/dist/powersync/schema/notesExtras.js +0 -1
- package/dist/powersync/schema/projects.d.ts +0 -1
- package/dist/powersync/schema/projects.js +0 -1
- package/dist/powersync/schema/savedViews.d.ts +0 -1
- package/dist/powersync/schema/savedViews.js +0 -1
- package/dist/powersync/schema/storage.d.ts +0 -1
- package/dist/powersync/schema/storage.js +0 -1
- package/dist/powersync/schema/tags.d.ts +0 -1
- package/dist/powersync/schema/tags.js +0 -1
- package/dist/powersync/syncGate.d.ts +0 -45
- package/dist/powersync/syncGate.js +0 -45
- package/dist/powersync/syncPass.d.ts +0 -9
- package/dist/powersync/syncPass.js +0 -33
- package/dist/powersync/tokenIndex.d.ts +0 -32
- package/dist/powersync/tokenIndex.js +0 -382
- package/dist/powersync/uploader.d.ts +0 -22
- package/dist/powersync/uploader.js +0 -231
- package/dist/requests/execute.d.ts +0 -11
- package/dist/requests/execute.js +0 -26
- package/dist/requests/store.d.ts +0 -10
- package/dist/requests/store.js +0 -190
- package/dist/runCli.d.ts +0 -2
- package/dist/runCli.js +0 -64
- package/dist/skills/check.d.ts +0 -7
- package/dist/skills/check.js +0 -747
- package/dist/skills/commandRefs.d.ts +0 -21
- package/dist/skills/commandRefs.js +0 -124
- package/dist/skills/generate.d.ts +0 -13
- package/dist/skills/generate.js +0 -80
- package/dist/skills/registry.d.ts +0 -13
- package/dist/skills/registry.js +0 -65
- package/dist/skills/retired.d.ts +0 -60
- package/dist/skills/retired.js +0 -58
- package/dist/utils/abort.d.ts +0 -6
- package/dist/utils/abort.js +0 -19
- package/dist/utils/argValue.d.ts +0 -1
- package/dist/utils/argValue.js +0 -18
- package/dist/utils/asyncRelease.d.ts +0 -2
- package/dist/utils/asyncRelease.js +0 -25
- package/dist/utils/authToken.d.ts +0 -4
- package/dist/utils/authToken.js +0 -28
- package/dist/utils/bidlinkCanonicalization.d.ts +0 -2
- package/dist/utils/bidlinkCanonicalization.js +0 -164
- package/dist/utils/consoleEncoding.d.ts +0 -5
- package/dist/utils/consoleEncoding.js +0 -27
- package/dist/utils/cursor.d.ts +0 -9
- package/dist/utils/cursor.js +0 -61
- package/dist/utils/deadline.d.ts +0 -8
- package/dist/utils/deadline.js +0 -31
- package/dist/utils/defaultFormat.d.ts +0 -8
- package/dist/utils/defaultFormat.js +0 -38
- package/dist/utils/dryRun.d.ts +0 -32
- package/dist/utils/dryRun.js +0 -88
- package/dist/utils/errorCodes.d.ts +0 -595
- package/dist/utils/errorCodes.js +0 -163
- package/dist/utils/errors.d.ts +0 -54
- package/dist/utils/errors.js +0 -277
- package/dist/utils/id.d.ts +0 -1
- package/dist/utils/id.js +0 -4
- package/dist/utils/nodeRuntime.d.ts +0 -4
- package/dist/utils/nodeRuntime.js +0 -12
- package/dist/utils/output.d.ts +0 -26
- package/dist/utils/output.js +0 -262
- package/dist/utils/processExit.d.ts +0 -1
- package/dist/utils/processExit.js +0 -33
- package/dist/utils/progress.d.ts +0 -25
- package/dist/utils/progress.js +0 -59
- package/dist/utils/redact.d.ts +0 -1
- package/dist/utils/redact.js +0 -10
- package/dist/utils/requestContext.d.ts +0 -32
- package/dist/utils/requestContext.js +0 -13
- package/dist/utils/select.d.ts +0 -20
- package/dist/utils/select.js +0 -92
- package/dist/utils/sqliteLease.d.ts +0 -8
- package/dist/utils/sqliteLease.js +0 -59
- package/dist/utils/syncTimeout.d.ts +0 -7
- package/dist/utils/syncTimeout.js +0 -20
- package/dist/utils/terminalSanitization.d.ts +0 -2
- package/dist/utils/terminalSanitization.js +0 -37
- package/dist/utils/text.d.ts +0 -1
- package/dist/utils/text.js +0 -35
- package/dist/utils/time.d.ts +0 -1
- package/dist/utils/time.js +0 -3
- package/dist/utils/tiptapMarkdown.d.ts +0 -9
- package/dist/utils/tiptapMarkdown.js +0 -367
- package/dist/utils/tiptapMarkdownSchema.d.ts +0 -37
- package/dist/utils/tiptapMarkdownSchema.js +0 -608
- package/dist/utils/tiptapMarkdownSchemaUtils.d.ts +0 -74
- package/dist/utils/tiptapMarkdownSchemaUtils.js +0 -394
- package/dist/utils/tiptapMarkdownSyntax.d.ts +0 -9
- package/dist/utils/tiptapMarkdownSyntax.js +0 -249
- package/dist/utils/tokenize.d.ts +0 -1
- package/dist/utils/tokenize.js +0 -67
- package/dist/utils/updateNotice.d.ts +0 -8
- package/dist/utils/updateNotice.js +0 -112
- package/dist/utils/usageError.d.ts +0 -37
- package/dist/utils/usageError.js +0 -127
- package/dist/utils/version.d.ts +0 -1
- package/dist/utils/version.js +0 -21
- package/dist/vendor/electron/domain/note-templates.d.ts +0 -3
- package/dist/vendor/electron/domain/note-templates.js +0 -232
- package/dist/vendor/electron/domain/properties.d.ts +0 -10
- package/dist/vendor/electron/domain/properties.js +0 -1549
- package/dist/vendor/electron/domain/saved-view-analytics.d.ts +0 -45
- package/dist/vendor/electron/domain/saved-view-analytics.js +0 -365
- package/dist/vendor/electron/domain/saved-view-relative-date.d.ts +0 -21
- package/dist/vendor/electron/domain/saved-view-relative-date.js +0 -153
- package/dist/vendor/electron/domain/saved-views.d.ts +0 -61
- package/dist/vendor/electron/domain/saved-views.js +0 -1120
- package/dist/vendor/electron/rpc.d.ts +0 -22
- package/dist/vendor/electron/rpc.js +0 -27
- package/dist/vendor/electron/shared/ai-errors.d.ts +0 -11
- package/dist/vendor/electron/shared/ai-errors.js +0 -107
- package/dist/vendor/electron/shared/external-types.d.ts +0 -20
- package/dist/vendor/electron/shared/external-types.js +0 -1
- package/dist/vendor/electron/shared/index.d.ts +0 -9
- package/dist/vendor/electron/shared/index.js +0 -7
- package/dist/vendor/electron/shared/note-properties.d.ts +0 -328
- package/dist/vendor/electron/shared/note-properties.js +0 -1027
- package/dist/vendor/electron/shared/note-templates.d.ts +0 -82
- package/dist/vendor/electron/shared/note-templates.js +0 -84
- package/dist/vendor/electron/shared/powersync-read-models.d.ts +0 -1716
- package/dist/vendor/electron/shared/powersync-read-models.js +0 -1
- package/dist/vendor/electron/shared/remote-device-agent.d.ts +0 -375
- package/dist/vendor/electron/shared/remote-device-agent.js +0 -191
- package/dist/vendor/electron/shared/saved-views.d.ts +0 -394
- package/dist/vendor/electron/shared/saved-views.js +0 -981
- package/dist/vendor/electron/sql-utils.d.ts +0 -5
- package/dist/vendor/electron/sql-utils.js +0 -32
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import { createRequire as __dinoxCreateRequire } from 'node:module';
|
|
2
|
+
const require = __dinoxCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/utils/errorCodes.ts
|
|
5
|
+
var ERROR_CODES = {
|
|
6
|
+
ALREADY_EXISTS: { exitCode: 5, description: "The target resource already exists." },
|
|
7
|
+
AUTH_INVALID: { exitCode: 3, description: "The configured credentials were rejected." },
|
|
8
|
+
AUTH_PAIRING_FAILED: { exitCode: 3, description: "Device QR login failed because the server rejected the pairing request." },
|
|
9
|
+
AUTH_PAIRING_TIMEOUT: { exitCode: 3, description: "Device QR login timed out before the phone approved this computer." },
|
|
10
|
+
AUTH_PAIRING_UNSUPPORTED: { exitCode: 3, description: "This server does not accept the CLI device type for QR login yet." },
|
|
11
|
+
AUTH_REQUIRED: { exitCode: 3, description: "The command needs an authenticated Dinox account." },
|
|
12
|
+
AUTH_STATE_CHANGED: { exitCode: 3, description: "Authentication changed while the command was running." },
|
|
13
|
+
CACHE_CLEANUP_FAILED: { exitCode: 1, description: "Local cache cleanup after logout did not complete." },
|
|
14
|
+
CLIP_BLOCKED: { exitCode: 1, description: "The site blocked the local page capture (anti-bot / captcha); retry later, with --proxy, or with cookies." },
|
|
15
|
+
CLIP_BROWSER_MISSING: { exitCode: 5, description: "The Camoufox browser for local clips is not installed (run `dino clip setup`)." },
|
|
16
|
+
CLIP_CONTENT_NOT_FOUND: { exitCode: 5, description: "The link has no clippable content (deleted, private, or not an article)." },
|
|
17
|
+
CLIP_EXTRACT_FAILED: { exitCode: 1, description: "Fetching or converting the link on this computer failed." },
|
|
18
|
+
CLIP_LOGIN_REQUIRED: { exitCode: 5, description: "The site needs a logged-in session: import the user's cookies (`dino clip cookies-import`)." },
|
|
19
|
+
CLIP_PLATFORM_UNSUPPORTED: { exitCode: 2, description: "Local clipping does not support this link's platform yet." },
|
|
20
|
+
CLIP_TOOL_MISSING: { exitCode: 5, description: "A video or podcast clip needs yt-dlp / ffmpeg on PATH; the user must install them." },
|
|
21
|
+
COMMAND_FAILED: { exitCode: 1, description: "Generic command failure without a more specific code." },
|
|
22
|
+
CONFIG_INVALID_JSON: { exitCode: 1, description: "The CLI config file is not valid JSON." },
|
|
23
|
+
CONFIG_WRITE_BUSY: { exitCode: 1, description: "Another process is writing the CLI config." },
|
|
24
|
+
DAEMON_COMMAND_NOT_FORWARDABLE: { exitCode: 2, description: "The command must run in the CLI process." },
|
|
25
|
+
DAEMON_ERROR: { exitCode: 5, description: "The background daemon reported an error." },
|
|
26
|
+
DAEMON_INSTANCE_CHANGED: { exitCode: 1, description: "The daemon instance changed between requests." },
|
|
27
|
+
DAEMON_INSTANCE_MISMATCH: { exitCode: 1, description: "The running daemon belongs to a different CLI version or account." },
|
|
28
|
+
DAEMON_INSTANCE_UNKNOWN: { exitCode: 1, description: "The daemon identity could not be verified." },
|
|
29
|
+
DAEMON_LEGACY_UNVERIFIED: { exitCode: 1, description: "A daemon from an older CLI could not be verified safely." },
|
|
30
|
+
DAEMON_RELEASE_FAILED: { exitCode: 1, description: "The daemon could not release database ownership." },
|
|
31
|
+
DAEMON_RELEASE_TIMEOUT: { exitCode: 1, description: "The daemon did not release database ownership in time." },
|
|
32
|
+
DAEMON_SERVICE_FAILED: { exitCode: 1, description: "The service manager (launchd / systemd) rejected a daemon service operation." },
|
|
33
|
+
DAEMON_SERVICE_FOREIGN: { exitCode: 1, description: "The daemon service runs another dino install; it was left unchanged." },
|
|
34
|
+
DAEMON_SERVICE_UNSUPPORTED: { exitCode: 5, description: "The daemon cannot run as a login service on this platform or with this auth setup." },
|
|
35
|
+
DAEMON_STALE: { exitCode: 5, description: "The daemon state is stale and needs a restart." },
|
|
36
|
+
DAEMON_START_FAILED: { exitCode: 5, description: "The daemon process failed to start." },
|
|
37
|
+
DAEMON_START_TIMEOUT: { exitCode: 1, description: "The daemon did not become ready in time." },
|
|
38
|
+
DAEMON_STOP_FAILED: { exitCode: 1, description: "The daemon could not be stopped." },
|
|
39
|
+
DAEMON_UNAVAILABLE: { exitCode: 1, description: "The daemon is not available for this request." },
|
|
40
|
+
DAEMON_UNREACHABLE: { exitCode: 1, description: "The daemon socket could not be reached." },
|
|
41
|
+
EDITOR_ANCHOR_AMBIGUOUS: { exitCode: 2, description: "The suggestion anchor occurs more than once in the open note." },
|
|
42
|
+
EDITOR_ANCHOR_MISSING: { exitCode: 2, description: "The suggestion anchor does not occur in the open note." },
|
|
43
|
+
EDITOR_INVALID_DOCUMENT: { exitCode: 2, description: "The editor document cannot be saved without losing content." },
|
|
44
|
+
EDITOR_NOTE_NOT_OPEN: { exitCode: 5, description: "The editor session has no open note." },
|
|
45
|
+
EDITOR_STALE_SEQUENCE: { exitCode: 5, description: "The editor request targets a note the session has since replaced." },
|
|
46
|
+
EDITOR_UNKNOWN_BLOCK: { exitCode: 2, description: "The suggestion targets a block that is no longer in the open note." },
|
|
47
|
+
EDITOR_UNSAVED_CHANGES: { exitCode: 5, description: "The editor session has unsaved changes." },
|
|
48
|
+
INTERNAL_ERROR: { exitCode: 1, description: "Unexpected internal error; not a DinoxError." },
|
|
49
|
+
INVALID_ARGUMENT: { exitCode: 2, description: "An argument or option value is invalid." },
|
|
50
|
+
INVALID_PROPERTY_DEF_CONFIG: { exitCode: 1, description: "A property definition config could not be serialized." },
|
|
51
|
+
INVALID_PROPERTY_DEF_ID: { exitCode: 1, description: "A property definition id is missing or blank." },
|
|
52
|
+
INVALID_PROPERTY_OPTIONS: { exitCode: 1, description: "Property options could not be serialized." },
|
|
53
|
+
INVALID_STORAGE_KEY: { exitCode: 2, description: "The storage object key is invalid." },
|
|
54
|
+
NOTE_INVALID_PROPERTIES: { exitCode: 1, description: "Note properties are invalid." },
|
|
55
|
+
NOTE_NOT_FOUND: { exitCode: 5, description: "The note does not exist or is deleted." },
|
|
56
|
+
NOTE_PROPERTIES_CORRUPT: { exitCode: 1, description: "The note properties JSON is corrupt and cannot be mutated safely." },
|
|
57
|
+
NOTE_PROPERTIES_INVALID: { exitCode: 1, description: "The note properties mutation is invalid." },
|
|
58
|
+
NOTE_PROPERTIES_MUTATION_FAILED: { exitCode: 1, description: "The note properties mutation could not be applied." },
|
|
59
|
+
NOTE_PROPERTY_ORDER_STALE: { exitCode: 5, description: "The property slot order no longer matches the note; re-read and retry." },
|
|
60
|
+
NOTE_TEMPLATE_INVALID_CONTENT: { exitCode: 1, description: "The note template content is invalid." },
|
|
61
|
+
NOTE_TEMPLATE_INVALID_PROPERTY_DEF: { exitCode: 1, description: "A note template property definition is invalid." },
|
|
62
|
+
NOTE_TEMPLATE_INVALID_TOKEN_CONTEXT: { exitCode: 1, description: "A note template token is used in an invalid context." },
|
|
63
|
+
NOTE_TEMPLATE_NOT_FOUND: { exitCode: 5, description: "The note template does not exist or is deleted." },
|
|
64
|
+
NOTE_TEMPLATE_UNSUPPORTED_PROPERTY_DEF_VERSION: { exitCode: 1, description: "The note template property definition version is unsupported." },
|
|
65
|
+
NOT_FOUND: { exitCode: 5, description: "The requested resource was not found." },
|
|
66
|
+
POWERSYNC_OWNER_BUSY: { exitCode: 1, description: "Another process owns the local PowerSync database." },
|
|
67
|
+
PRECONDITION_FAILED: { exitCode: 5, description: "A safety precondition for the operation did not hold." },
|
|
68
|
+
PROPERTY_DATE_INVALID: { exitCode: 1, description: "A date property value is not a valid date." },
|
|
69
|
+
PROPERTY_DEF_CONFIG_INVALID: { exitCode: 1, description: "A property definition config is invalid." },
|
|
70
|
+
PROPERTY_DEF_CONFIG_TYPE_MISMATCH: { exitCode: 1, description: "A property definition config does not match the property type." },
|
|
71
|
+
PROPERTY_DEF_ENSURE_FAILED: { exitCode: 1, description: "The property definition could not be created or reused." },
|
|
72
|
+
PROPERTY_DEF_ENSURE_INPUT_INVALID: { exitCode: 1, description: "The property definition create input is invalid." },
|
|
73
|
+
PROPERTY_DEF_NOT_FOUND: { exitCode: 5, description: "The property definition does not exist or is deleted." },
|
|
74
|
+
PROPERTY_DEF_TYPE_CONFLICT: { exitCode: 5, description: "A property with this key already exists with a different type." },
|
|
75
|
+
PROPERTY_DEF_TYPE_INVALID: { exitCode: 1, description: "The stored property definition type is invalid." },
|
|
76
|
+
PROPERTY_FILES_INVALID: { exitCode: 1, description: "A files property value is invalid." },
|
|
77
|
+
PROPERTY_LEGACY_OPTION_LABEL_INVALID: { exitCode: 1, description: "A legacy option label cannot be migrated." },
|
|
78
|
+
PROPERTY_LEGACY_OPTION_NOT_PLANNED: { exitCode: 1, description: "A legacy option value was not covered by the migration plan." },
|
|
79
|
+
PROPERTY_LEGACY_VALUE_INVALID: { exitCode: 1, description: "A legacy option value cannot be migrated." },
|
|
80
|
+
PROPERTY_MULTI_SELECT_EMPTY: { exitCode: 1, description: "A multi-select property value is empty." },
|
|
81
|
+
PROPERTY_MULTI_SELECT_LIMIT_EXCEEDED: { exitCode: 1, description: "A multi-select property value has too many selections." },
|
|
82
|
+
PROPERTY_NUMBER_INVALID: { exitCode: 1, description: "A number property value is invalid or out of range." },
|
|
83
|
+
PROPERTY_OPTIONS_INVALID: { exitCode: 1, description: "Stored property options are invalid." },
|
|
84
|
+
PROPERTY_OPTIONS_MIGRATION_REQUIRED: { exitCode: 5, description: "Legacy property options must be migrated first (dino prop migrate-options)." },
|
|
85
|
+
PROPERTY_OPTIONS_TYPE_MISMATCH: { exitCode: 1, description: "Options were supplied for a property type that has none." },
|
|
86
|
+
PROPERTY_OPTION_ARCHIVED: { exitCode: 5, description: "The select option is archived and cannot be assigned." },
|
|
87
|
+
PROPERTY_OPTION_ID_DUPLICATE: { exitCode: 1, description: "Property options contain duplicate ids." },
|
|
88
|
+
PROPERTY_OPTION_ID_UNKNOWN: { exitCode: 1, description: "A property option id does not exist on the definition." },
|
|
89
|
+
PROPERTY_OPTION_LABEL_INVALID: { exitCode: 1, description: "A property option label is blank, too long, or duplicated." },
|
|
90
|
+
PROPERTY_OPTION_LIMIT_EXCEEDED: { exitCode: 1, description: "The property has too many options." },
|
|
91
|
+
PROPERTY_OPTION_NEW_ID_FORBIDDEN: { exitCode: 1, description: "New property options must not carry an id." },
|
|
92
|
+
PROPERTY_OPTION_NOT_FOUND: { exitCode: 5, description: "The select option does not exist on a closed property." },
|
|
93
|
+
PROPERTY_OPTION_REMOVAL_REQUIRES_ARCHIVE: { exitCode: 1, description: "Existing property options must be archived instead of removed." },
|
|
94
|
+
PROPERTY_OPTION_REPAIR_ID_FORBIDDEN: { exitCode: 1, description: "Repair options must not carry ids." },
|
|
95
|
+
PROPERTY_OPTION_SORT_RANK_EXHAUSTED: { exitCode: 1, description: "No sort rank is left for a new property option." },
|
|
96
|
+
PROPERTY_OPTION_VALUE_INVALID: { exitCode: 1, description: "A select property value is invalid." },
|
|
97
|
+
PROPERTY_PLACE_INVALID: { exitCode: 1, description: "A place property value is invalid." },
|
|
98
|
+
PROPERTY_RELATION_EMPTY: { exitCode: 1, description: "A relation property value is empty." },
|
|
99
|
+
PROPERTY_RELATION_INVALID: { exitCode: 1, description: "A relation property value references invalid notes." },
|
|
100
|
+
PROPERTY_RELATION_LIMIT: { exitCode: 1, description: "A relation property value has too many notes." },
|
|
101
|
+
PROPERTY_TYPE_NOT_ACTIVE: { exitCode: 1, description: "The property type is not active." },
|
|
102
|
+
PROPERTY_UNIQUE_ID_CONFIG_INVALID: { exitCode: 1, description: "A unique-id property counter is invalid." },
|
|
103
|
+
PROPERTY_UNIQUE_ID_INVALID: { exitCode: 1, description: "A unique-id property value is invalid." },
|
|
104
|
+
PROPERTY_UNIQUE_ID_TYPE_MISMATCH: { exitCode: 1, description: "A unique-id setting was supplied for a different property type." },
|
|
105
|
+
PROPERTY_URL_INVALID: { exitCode: 1, description: "A url property value is invalid." },
|
|
106
|
+
PROPERTY_VALUE_INVALID: { exitCode: 1, description: "A property value does not match its definition." },
|
|
107
|
+
REQUEST_ID_CONFLICT: { exitCode: 2, description: "The request id was already used for different arguments." },
|
|
108
|
+
REQUEST_INTERRUPTED: { exitCode: 1, description: "The earlier request owner exited; its outcome is unknown." },
|
|
109
|
+
REQUEST_IN_PROGRESS: { exitCode: 1, description: "The earlier request is still running; retry with the same id." },
|
|
110
|
+
SAVED_VIEW_FILTER_CORRUPT: { exitCode: 1, description: "A stored saved view filter is corrupt." },
|
|
111
|
+
SAVED_VIEW_FILTER_TOO_COMPLEX: { exitCode: 1, description: "The saved view filter exceeds supported complexity." },
|
|
112
|
+
SAVED_VIEW_FILTER_VALUE_REQUIRED: { exitCode: 5, description: "A saved view filter condition is missing its value." },
|
|
113
|
+
SAVED_VIEW_INVALID_CONFIG: { exitCode: 1, description: "The saved view config is invalid." },
|
|
114
|
+
SAVED_VIEW_INVALID_CURRENT_TIME: { exitCode: 1, description: "The reference time for dynamic date filters is invalid." },
|
|
115
|
+
SAVED_VIEW_INVALID_DATE_VALUE: { exitCode: 1, description: "A saved view date value is not a real calendar date." },
|
|
116
|
+
SAVED_VIEW_INVALID_FIELD: { exitCode: 1, description: "A saved view references an invalid field." },
|
|
117
|
+
SAVED_VIEW_INVALID_FILTER: { exitCode: 1, description: "The saved view filter is invalid." },
|
|
118
|
+
SAVED_VIEW_INVALID_OPERATOR: { exitCode: 1, description: "A saved view filter operator is invalid." },
|
|
119
|
+
SAVED_VIEW_INVALID_RELATIVE_DAYS: { exitCode: 1, description: "withinLastDays requires an integer day count in range." },
|
|
120
|
+
SAVED_VIEW_INVALID_ROW: { exitCode: 1, description: "A stored saved view row is invalid." },
|
|
121
|
+
SAVED_VIEW_INVALID_TIME_ZONE: { exitCode: 2, description: "The time zone is not a valid IANA time zone." },
|
|
122
|
+
SAVED_VIEW_NOT_FOUND: { exitCode: 5, description: "The saved view does not exist." },
|
|
123
|
+
SAVED_VIEW_OPERATOR_TYPE_MISMATCH: { exitCode: 1, description: "A filter operator is not valid for the field type." },
|
|
124
|
+
SAVED_VIEW_OPTION_NOT_FOUND: { exitCode: 5, description: "A select option id referenced by the view does not exist." },
|
|
125
|
+
SAVED_VIEW_PROPERTY_CONFIG_INVALID: { exitCode: 1, description: "A property configuration used by the view is invalid." },
|
|
126
|
+
SAVED_VIEW_PROPERTY_INVALID: { exitCode: 1, description: "A property used by the view is invalid." },
|
|
127
|
+
SAVED_VIEW_PROPERTY_NOT_FOUND: { exitCode: 5, description: "A property referenced by the view does not exist." },
|
|
128
|
+
SAVED_VIEW_PROPERTY_OPTIONS_INVALID: { exitCode: 1, description: "Property options used by the view are invalid." },
|
|
129
|
+
SAVED_VIEW_PROPERTY_OPTIONS_MIGRATION_REQUIRED: { exitCode: 5, description: "Property options need migration before use." },
|
|
130
|
+
SAVED_VIEW_SORT_TYPE_UNSUPPORTED: { exitCode: 1, description: "The field type cannot be sorted." },
|
|
131
|
+
SAVED_VIEW_TIME_ZONE_CONVERSION_FAILED: { exitCode: 1, description: "A dynamic date boundary could not be converted to the time zone." },
|
|
132
|
+
SAVED_VIEW_UNSUPPORTED_CONFIG_VERSION: { exitCode: 1, description: "The saved view config version is unsupported." },
|
|
133
|
+
SAVED_VIEW_UNSUPPORTED_FILTER_VERSION: { exitCode: 1, description: "The saved view filter version is unsupported." },
|
|
134
|
+
SAVED_VIEW_UNSUPPORTED_LAYOUT: { exitCode: 1, description: "The saved view layout is unsupported." },
|
|
135
|
+
SAVED_VIEW_VALUE_TYPE_MISMATCH: { exitCode: 1, description: "A filter value does not match the field type." },
|
|
136
|
+
SCHEMA_PATH_NOT_FOUND: { exitCode: 5, description: "No command schema exists for the requested path." },
|
|
137
|
+
SEMANTIC_SEARCH_UNAVAILABLE: { exitCode: 1, description: "The semantic search service could not be reached or failed; keyword search (note search) still works." },
|
|
138
|
+
SKILLS_LOCK_INVALID: { exitCode: 1, description: "The skills installer lock file is malformed." },
|
|
139
|
+
SKILLS_LOCK_READ_FAILED: { exitCode: 1, description: "The skills installer lock file could not be read." },
|
|
140
|
+
SKILLS_MIGRATION_FAILED: { exitCode: 1, description: "The skills installer failed during migration." },
|
|
141
|
+
SKILLS_MIGRATION_PRECONDITION_FAILED: { exitCode: 1, description: "The skills lock changed before migration ran." },
|
|
142
|
+
SKILLS_MIGRATION_VERIFICATION_FAILED: { exitCode: 1, description: "Post-migration verification did not match the plan." },
|
|
143
|
+
STORAGE_IMAGE_PROCESSING_UNAVAILABLE: { exitCode: 1, description: "The optional sharp image library is unavailable, so image uploads are refused." },
|
|
144
|
+
STORAGE_OBJECT_ALREADY_EXISTS: { exitCode: 5, description: "The storage object already exists; overwrite was not confirmed." },
|
|
145
|
+
STORAGE_RESOURCE_INSERT_FAILED: { exitCode: 1, description: "The uploaded object could not be recorded as a resource." },
|
|
146
|
+
STORAGE_TEST_CLEANUP_FAILED: { exitCode: 1, description: "The storage connectivity test object could not be removed." },
|
|
147
|
+
STORAGE_THUMBNAIL_UPLOAD_FAILED: { exitCode: 1, description: "The thumbnail upload failed." },
|
|
148
|
+
STORAGE_UPLOAD_OUTCOME_UNKNOWN: { exitCode: 1, description: "The upload outcome is unknown; verify before retrying." },
|
|
149
|
+
SYNC_REQUIRED: { exitCode: 4, description: "Fresh sync was required (--require-sync) but not confirmed." },
|
|
150
|
+
SYNC_STALE: { exitCode: 4, description: "The local cache is stale." },
|
|
151
|
+
SYNC_TIMEOUT: { exitCode: 4, description: "Sync did not complete within the timeout." },
|
|
152
|
+
TODO_TASK_LOOKUP_TRUNCATED: { exitCode: 1, description: "Task lookup hit its scan limit; pass --note-id." },
|
|
153
|
+
TODO_TASK_NOT_FOUND: { exitCode: 5, description: "The todo task does not exist." },
|
|
154
|
+
UNAUTHENTICATED: { exitCode: 3, description: "The backend rejected the request as unauthenticated." },
|
|
155
|
+
UNSUPPORTED_CRUD_OPERATION: { exitCode: 1, description: "A queued upload contains an unsupported operation." },
|
|
156
|
+
UPDATE_FAILED: { exitCode: 1, description: "The CLI self-update failed." },
|
|
157
|
+
UPLOAD_PENDING: { exitCode: 4, description: "Local writes are still waiting to upload." },
|
|
158
|
+
USAGE_ERROR: { exitCode: 2, description: "Invalid command usage, arguments, or flags." }
|
|
159
|
+
};
|
|
160
|
+
function isRegisteredErrorCode(code) {
|
|
161
|
+
return Object.prototype.hasOwnProperty.call(ERROR_CODES, code);
|
|
162
|
+
}
|
|
163
|
+
function listErrorCodes() {
|
|
164
|
+
return Object.keys(ERROR_CODES).sort().map((code) => ({ code, ...ERROR_CODES[code] }));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// src/utils/errors.ts
|
|
168
|
+
function wireErrorCode(code) {
|
|
169
|
+
return code;
|
|
170
|
+
}
|
|
171
|
+
var DinoxError = class extends Error {
|
|
172
|
+
exitCode;
|
|
173
|
+
details;
|
|
174
|
+
code;
|
|
175
|
+
suggestion;
|
|
176
|
+
suggestedAction;
|
|
177
|
+
recoverable;
|
|
178
|
+
requiresProcessExit;
|
|
179
|
+
constructor(message, options) {
|
|
180
|
+
super(message);
|
|
181
|
+
const code = normalizeErrorCode(options?.code ?? inferDinoxErrorCode(message));
|
|
182
|
+
const suggestion = options?.suggestion ?? defaultSuggestionForCode(code);
|
|
183
|
+
this.name = "DinoxError";
|
|
184
|
+
this.exitCode = options?.exitCode ?? exitCodeForErrorCode(code);
|
|
185
|
+
this.details = options?.details;
|
|
186
|
+
this.code = code;
|
|
187
|
+
this.suggestion = suggestion;
|
|
188
|
+
this.suggestedAction = options?.suggestedAction ?? suggestedActionFromSuggestion(suggestion) ?? defaultSuggestedActionForCode(code, message);
|
|
189
|
+
this.recoverable = options?.recoverable ?? true;
|
|
190
|
+
this.requiresProcessExit = options?.requiresProcessExit ?? false;
|
|
191
|
+
if (options?.cause !== void 0) {
|
|
192
|
+
this.cause = options.cause;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
function isDinoxError(error) {
|
|
197
|
+
return Boolean(error) && typeof error === "object" && error.name === "DinoxError" && typeof error.exitCode === "number";
|
|
198
|
+
}
|
|
199
|
+
function serializeCause(error) {
|
|
200
|
+
if (!error || typeof error !== "object" || !("cause" in error)) {
|
|
201
|
+
return void 0;
|
|
202
|
+
}
|
|
203
|
+
const cause = error.cause;
|
|
204
|
+
if (cause === void 0) {
|
|
205
|
+
return void 0;
|
|
206
|
+
}
|
|
207
|
+
if (cause instanceof Error) {
|
|
208
|
+
return {
|
|
209
|
+
name: cause.name,
|
|
210
|
+
message: cause.message,
|
|
211
|
+
...cause.stack ? { stack: cause.stack } : {}
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
name: "Error",
|
|
216
|
+
message: String(cause)
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function buildStructuredErrorPayload(error, verbose) {
|
|
220
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
221
|
+
const name = error instanceof Error ? error.name : "Error";
|
|
222
|
+
const stack = error instanceof Error ? error.stack : void 0;
|
|
223
|
+
if (isDinoxError(error)) {
|
|
224
|
+
const cause = verbose ? serializeCause(error) : void 0;
|
|
225
|
+
return {
|
|
226
|
+
name,
|
|
227
|
+
code: error.code,
|
|
228
|
+
message,
|
|
229
|
+
recoverable: error.recoverable,
|
|
230
|
+
exit_code: error.exitCode,
|
|
231
|
+
...error.suggestion ? { suggestion: error.suggestion } : {},
|
|
232
|
+
...error.suggestedAction ? { suggested_action: error.suggestedAction } : {},
|
|
233
|
+
...error.details !== void 0 ? { details: error.details } : {},
|
|
234
|
+
...cause ? { cause } : {},
|
|
235
|
+
...verbose && stack ? { stack } : {}
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
name,
|
|
240
|
+
code: "INTERNAL_ERROR",
|
|
241
|
+
message,
|
|
242
|
+
recoverable: false,
|
|
243
|
+
exit_code: 1,
|
|
244
|
+
suggested_action: {
|
|
245
|
+
command: "dino doctor --format json",
|
|
246
|
+
reason: "Inspect local auth, sync, index, daemon, and database health before retrying."
|
|
247
|
+
},
|
|
248
|
+
...verbose && stack ? { stack } : {}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function normalizeErrorCode(value) {
|
|
252
|
+
const normalized = value.trim().toUpperCase().replace(/[^A-Z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
|
|
253
|
+
return normalized || "COMMAND_FAILED";
|
|
254
|
+
}
|
|
255
|
+
function inferDinoxErrorCode(message) {
|
|
256
|
+
const text = message.trim();
|
|
257
|
+
const lower = text.toLowerCase();
|
|
258
|
+
if (/cache is not fully synchronized|stale|\bsync required\b|\bsync timed out\b|\bsync could not\b/.test(lower)) {
|
|
259
|
+
return "SYNC_STALE";
|
|
260
|
+
}
|
|
261
|
+
if (lower.includes("not logged in") || lower.includes("auth login") || lower.includes("missing resolved userid") || lower.includes("requires a logged-in user") || lower.includes("missing backend base url")) {
|
|
262
|
+
return "AUTH_REQUIRED";
|
|
263
|
+
}
|
|
264
|
+
if (text.startsWith("--") || /^(invalid|provide|at least one|conflicting|missing|token is required|file path is required|note id is required|taskid is required|prompt name is required|prompt text is required|tag name is required|box path is required)/i.test(text) || /\b(must be|requires|cannot be used together|expected|one of|required)\b/i.test(text)) {
|
|
265
|
+
return "USAGE_ERROR";
|
|
266
|
+
}
|
|
267
|
+
if (/\b(not found|unknown|does not exist|no active|no eligible|no custom|not available)\b/i.test(text)) {
|
|
268
|
+
return "NOT_FOUND";
|
|
269
|
+
}
|
|
270
|
+
if (/\b(already exists|duplicate|refusing|ambiguous|not unique|deleted|expired|changed after|does not match|belongs to a different user|cannot move|cannot merge|protected)\b/i.test(text)) {
|
|
271
|
+
return "PRECONDITION_FAILED";
|
|
272
|
+
}
|
|
273
|
+
if (lower.includes("daemon")) {
|
|
274
|
+
return "DAEMON_ERROR";
|
|
275
|
+
}
|
|
276
|
+
return "COMMAND_FAILED";
|
|
277
|
+
}
|
|
278
|
+
function exitCodeForErrorCode(code) {
|
|
279
|
+
const normalized = normalizeErrorCode(code);
|
|
280
|
+
if (isRegisteredErrorCode(normalized)) {
|
|
281
|
+
return ERROR_CODES[normalized].exitCode;
|
|
282
|
+
}
|
|
283
|
+
return legacyExitCodeForUnregisteredCode(normalized);
|
|
284
|
+
}
|
|
285
|
+
function legacyExitCodeForUnregisteredCode(normalized) {
|
|
286
|
+
if (normalized === "USAGE_ERROR" || normalized === "INVALID_ARGUMENT" || normalized.startsWith("INVALID_")) {
|
|
287
|
+
return 2;
|
|
288
|
+
}
|
|
289
|
+
if (normalized === "AUTH_REQUIRED" || normalized === "AUTH_INVALID" || normalized === "UNAUTHENTICATED" || normalized.startsWith("AUTH_")) {
|
|
290
|
+
return 3;
|
|
291
|
+
}
|
|
292
|
+
if (normalized === "SYNC_REQUIRED" || normalized === "SYNC_STALE" || normalized === "UPLOAD_PENDING" || normalized.startsWith("SYNC_")) {
|
|
293
|
+
return 4;
|
|
294
|
+
}
|
|
295
|
+
if (normalized === "PRECONDITION_FAILED" || normalized === "NOT_FOUND" || normalized === "ALREADY_EXISTS" || normalized === "DAEMON_STALE" || normalized === "DAEMON_ERROR" || normalized === "DAEMON_START_FAILED" || normalized.endsWith("_NOT_FOUND") || normalized.endsWith("_ALREADY_EXISTS") || normalized.endsWith("_REQUIRED")) {
|
|
296
|
+
return 5;
|
|
297
|
+
}
|
|
298
|
+
return 1;
|
|
299
|
+
}
|
|
300
|
+
function defaultSuggestionForCode(code) {
|
|
301
|
+
switch (normalizeErrorCode(code)) {
|
|
302
|
+
case "AUTH_REQUIRED":
|
|
303
|
+
case "AUTH_INVALID":
|
|
304
|
+
case "UNAUTHENTICATED":
|
|
305
|
+
return "Run `dino auth status --format json`; if auth is missing, set DINOX_TOKEN or pipe a token to `dino auth login --token-stdin` in your own terminal.";
|
|
306
|
+
case "SYNC_REQUIRED":
|
|
307
|
+
case "SYNC_STALE":
|
|
308
|
+
return "Run `dino sync --strict --sync-timeout 20000 --format json`, then retry the command.";
|
|
309
|
+
case "UPLOAD_PENDING":
|
|
310
|
+
return "Run `dino doctor --fix --format json` to wait for pending uploads and inspect sync health.";
|
|
311
|
+
case "DAEMON_STALE":
|
|
312
|
+
case "DAEMON_ERROR":
|
|
313
|
+
case "DAEMON_START_FAILED":
|
|
314
|
+
return "Run `dino doctor --fix --format json` to restart a stale daemon and inspect local health.";
|
|
315
|
+
case "USAGE_ERROR":
|
|
316
|
+
case "INVALID_ARGUMENT":
|
|
317
|
+
return "Run `dino schema --format json` to inspect valid commands, arguments, and flags.";
|
|
318
|
+
default: {
|
|
319
|
+
const normalized = normalizeErrorCode(code);
|
|
320
|
+
if (normalized.startsWith("AUTH_")) {
|
|
321
|
+
return "Run `dino auth status --format json`; if auth is missing, set DINOX_TOKEN or pipe a token to `dino auth login --token-stdin` in your own terminal.";
|
|
322
|
+
}
|
|
323
|
+
if (normalized.startsWith("SYNC_")) {
|
|
324
|
+
return "Run `dino sync --strict --sync-timeout 20000 --format json`, then retry the command.";
|
|
325
|
+
}
|
|
326
|
+
if (normalized.startsWith("DAEMON_")) {
|
|
327
|
+
return "Run `dino doctor --fix --format json` to restart a stale daemon and inspect local health.";
|
|
328
|
+
}
|
|
329
|
+
return void 0;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
function suggestedActionFromSuggestion(suggestion) {
|
|
334
|
+
if (!suggestion) {
|
|
335
|
+
return void 0;
|
|
336
|
+
}
|
|
337
|
+
const match = suggestion.match(/`(dino\s+[^`]+)`/) ?? suggestion.match(/['"](dino\s+[^'"]+)['"]/);
|
|
338
|
+
const command = match?.[1]?.trim();
|
|
339
|
+
if (!command) {
|
|
340
|
+
return void 0;
|
|
341
|
+
}
|
|
342
|
+
return {
|
|
343
|
+
command,
|
|
344
|
+
reason: suggestion
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function defaultSuggestedActionForCode(code, message) {
|
|
348
|
+
const normalized = normalizeErrorCode(code);
|
|
349
|
+
if (normalized === "AUTH_REQUIRED" || normalized === "AUTH_INVALID" || normalized === "UNAUTHENTICATED" || normalized.startsWith("AUTH_")) {
|
|
350
|
+
return {
|
|
351
|
+
command: "dino auth status --format json",
|
|
352
|
+
reason: "Confirm whether CLI authentication is configured before retrying."
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
if (normalized === "SYNC_REQUIRED" || normalized === "SYNC_STALE" || normalized.startsWith("SYNC_")) {
|
|
356
|
+
return {
|
|
357
|
+
command: "dino sync --strict --sync-timeout 20000 --format json",
|
|
358
|
+
reason: "Refresh the local PowerSync cache and prove freshness before retrying the read."
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
if (normalized === "UPLOAD_PENDING") {
|
|
362
|
+
return {
|
|
363
|
+
command: "dino doctor --fix --format json",
|
|
364
|
+
reason: "Drain pending uploads without discarding queued mutations, then recheck sync health."
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
if (normalized.startsWith("DAEMON_") || normalized === "DAEMON_ERROR") {
|
|
368
|
+
return {
|
|
369
|
+
command: "dino doctor --fix --format json",
|
|
370
|
+
reason: "Repair local daemon state and verify version/account freshness."
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
if (normalized.startsWith("CLIP_")) {
|
|
374
|
+
return {
|
|
375
|
+
command: "dino clip setup --check --format json",
|
|
376
|
+
reason: "Check the local clip browser, saved cookies and optional tools before retrying."
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
if (normalized === "USAGE_ERROR" || normalized === "INVALID_ARGUMENT") {
|
|
380
|
+
return {
|
|
381
|
+
command: "dino schema --format json",
|
|
382
|
+
reason: "Inspect valid command arguments and flags before retrying."
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
if (normalized === "NOT_FOUND" || normalized.endsWith("_NOT_FOUND")) {
|
|
386
|
+
return defaultNotFoundAction(message);
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
command: "dino doctor --format json",
|
|
390
|
+
reason: "Inspect auth, sync, index, daemon, and database health before retrying."
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function defaultNotFoundAction(message) {
|
|
394
|
+
if (/\bnote\b/i.test(message)) {
|
|
395
|
+
return {
|
|
396
|
+
command: "dino note search --format json",
|
|
397
|
+
reason: "Search notes to find a valid note id before retrying."
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
if (/\btag\b/i.test(message)) {
|
|
401
|
+
return {
|
|
402
|
+
command: "dino tag list --format json",
|
|
403
|
+
reason: "List existing tags before retrying."
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
if (/\b(box|zettel)\b/i.test(message)) {
|
|
407
|
+
return {
|
|
408
|
+
command: "dino box list --format json",
|
|
409
|
+
reason: "List existing zettel boxes before retrying."
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
if (/\bstorage\b/i.test(message)) {
|
|
413
|
+
return {
|
|
414
|
+
command: "dino storage list --format json",
|
|
415
|
+
reason: "List available storage configs before retrying."
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
if (/\bprompt\b/i.test(message)) {
|
|
419
|
+
return {
|
|
420
|
+
command: "dino prompt list --format json",
|
|
421
|
+
reason: "List existing prompts before retrying."
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
return {
|
|
425
|
+
command: "dino schema --format json",
|
|
426
|
+
reason: "Inspect available command paths and retry with an existing resource."
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export {
|
|
431
|
+
isRegisteredErrorCode,
|
|
432
|
+
listErrorCodes,
|
|
433
|
+
wireErrorCode,
|
|
434
|
+
DinoxError,
|
|
435
|
+
isDinoxError,
|
|
436
|
+
buildStructuredErrorPayload
|
|
437
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { createRequire as __dinoxCreateRequire } from 'node:module';
|
|
2
|
+
const require = __dinoxCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// ../../packages/clip-engine/src/bilibiliToMarkdown/errors.ts
|
|
5
|
+
var BilibiliToMarkdownError = class extends Error {
|
|
6
|
+
code;
|
|
7
|
+
details;
|
|
8
|
+
constructor(code, message, details) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = "BilibiliToMarkdownError";
|
|
11
|
+
this.code = code;
|
|
12
|
+
if (details !== void 0) this.details = details;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// ../../packages/clip-engine/src/bilibiliToMarkdown/url.ts
|
|
17
|
+
var BILIBILI_HOST_RE = /(^|\.)bilibili\.com$/i;
|
|
18
|
+
var B23_HOST_RE = /(^|\.)b23\.tv$/i;
|
|
19
|
+
var LOCALE_PATH_RE = /^\/(?:zh(?:-Hans|-CN|-TW|-HK)?|en(?:-US)?|ja(?:-JP)?)(?=\/)/i;
|
|
20
|
+
var VIDEO_PATH_RE = /^\/video\/(?:BV[0-9A-Za-z]+|av\d+)/i;
|
|
21
|
+
var OPUS_PATH_RE = /^\/opus\/(\d+)\/?$/;
|
|
22
|
+
var MOBILE_DYNAMIC_PATH_RE = /^\/dynamic\/(\d+)\/?$/;
|
|
23
|
+
var T_HOST_RE = /^t\.bilibili\.com$/i;
|
|
24
|
+
var T_PATH_RE = /^\/(\d+)\/?$/;
|
|
25
|
+
var READ_PATH_RE = /^\/read\/(?:cv|mobile\/)(\d+)\/?$/i;
|
|
26
|
+
function stripBilibiliLocalePath(pathname) {
|
|
27
|
+
return pathname.replace(LOCALE_PATH_RE, "");
|
|
28
|
+
}
|
|
29
|
+
function parseBilibiliPostRef(value) {
|
|
30
|
+
let parsed;
|
|
31
|
+
try {
|
|
32
|
+
parsed = new URL(value);
|
|
33
|
+
} catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
if (!/^https?:$/.test(parsed.protocol) || !BILIBILI_HOST_RE.test(parsed.hostname)) return null;
|
|
37
|
+
const path = stripBilibiliLocalePath(parsed.pathname);
|
|
38
|
+
if (T_HOST_RE.test(parsed.hostname)) {
|
|
39
|
+
const id = T_PATH_RE.exec(path)?.[1];
|
|
40
|
+
return id ? { id, kind: "dynamic" } : null;
|
|
41
|
+
}
|
|
42
|
+
const opus = OPUS_PATH_RE.exec(path)?.[1] ?? (/^m\./i.test(parsed.hostname) ? MOBILE_DYNAMIC_PATH_RE.exec(path)?.[1] : void 0);
|
|
43
|
+
if (opus) return { id: opus, kind: "dynamic" };
|
|
44
|
+
const article = READ_PATH_RE.exec(path)?.[1];
|
|
45
|
+
return article ? { id: article, kind: "article" } : null;
|
|
46
|
+
}
|
|
47
|
+
function normalizeBilibiliUrl(raw) {
|
|
48
|
+
let value = String(raw ?? "").trim();
|
|
49
|
+
if (!value) return "";
|
|
50
|
+
value = stripWrapper(value, '"');
|
|
51
|
+
value = stripWrapper(value, "'");
|
|
52
|
+
value = stripAngleWrapper(value);
|
|
53
|
+
value = value.replace(/\\+([:/&?=#%])/g, "$1");
|
|
54
|
+
value = decodeBasicHtmlEntities(value);
|
|
55
|
+
if (/^(?:www\.|m\.)?bilibili\.com\//i.test(value) || /^b23\.tv\//i.test(value) || value.startsWith("//")) {
|
|
56
|
+
value = `https://${value.replace(/^\/+/, "")}`;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
const parsed = new URL(value);
|
|
60
|
+
parsed.protocol = "https:";
|
|
61
|
+
parsed.hash = "";
|
|
62
|
+
if (B23_HOST_RE.test(parsed.hostname)) {
|
|
63
|
+
parsed.search = "";
|
|
64
|
+
return parsed.toString();
|
|
65
|
+
}
|
|
66
|
+
if (BILIBILI_HOST_RE.test(parsed.hostname)) {
|
|
67
|
+
const p = parsed.searchParams.get("p");
|
|
68
|
+
const pathname = stripBilibiliLocalePath(parsed.pathname);
|
|
69
|
+
const base = `${parsed.origin}${pathname}`;
|
|
70
|
+
return p ? `${base}?p=${p}` : base;
|
|
71
|
+
}
|
|
72
|
+
return value;
|
|
73
|
+
} catch {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function isBilibiliUrl(value) {
|
|
78
|
+
try {
|
|
79
|
+
const parsed = new URL(value);
|
|
80
|
+
if (parsed.protocol !== "https:") return false;
|
|
81
|
+
if (B23_HOST_RE.test(parsed.hostname)) return parsed.pathname.replace(/\/+$/, "").length > 1;
|
|
82
|
+
if (!BILIBILI_HOST_RE.test(parsed.hostname)) return false;
|
|
83
|
+
const path = stripBilibiliLocalePath(parsed.pathname);
|
|
84
|
+
return VIDEO_PATH_RE.test(path) || parseBilibiliPostRef(value) !== null;
|
|
85
|
+
} catch {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function assertBilibiliUrl(raw) {
|
|
90
|
+
const normalized = normalizeBilibiliUrl(raw);
|
|
91
|
+
if (!isBilibiliUrl(normalized)) {
|
|
92
|
+
throw new BilibiliToMarkdownError("INVALID_BILIBILI_URL", "expected a bilibili.com video / opus / dynamic / column or b23.tv URL", {
|
|
93
|
+
url: raw
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return normalized;
|
|
97
|
+
}
|
|
98
|
+
function stripWrapper(value, wrapper) {
|
|
99
|
+
return value.startsWith(wrapper) && value.endsWith(wrapper) ? value.slice(1, -1).trim() : value;
|
|
100
|
+
}
|
|
101
|
+
function stripAngleWrapper(value) {
|
|
102
|
+
return value.startsWith("<") && value.endsWith(">") ? value.slice(1, -1).trim() : value;
|
|
103
|
+
}
|
|
104
|
+
function decodeBasicHtmlEntities(value) {
|
|
105
|
+
return value.replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/</gi, "<").replace(/>/gi, ">").replace(/&#(\d+);/g, (_, code) => String.fromCodePoint(Number.parseInt(code, 10))).replace(/&#x([0-9a-f]+);/gi, (_, code) => String.fromCodePoint(Number.parseInt(code, 16)));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export {
|
|
109
|
+
BilibiliToMarkdownError,
|
|
110
|
+
parseBilibiliPostRef,
|
|
111
|
+
normalizeBilibiliUrl,
|
|
112
|
+
isBilibiliUrl,
|
|
113
|
+
assertBilibiliUrl
|
|
114
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createRequire as __dinoxCreateRequire } from 'node:module';
|
|
2
|
+
const require = __dinoxCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// ../../packages/clip-engine/src/imageFailureSamples.ts
|
|
5
|
+
var MAX_SAMPLES = 3;
|
|
6
|
+
var MAX_URL_CHARS = 160;
|
|
7
|
+
var MAX_MESSAGE_CHARS = 160;
|
|
8
|
+
function summarizeImageFailures(failed) {
|
|
9
|
+
const hosts = /* @__PURE__ */ new Set();
|
|
10
|
+
for (const item of failed) hosts.add(hostOf(item.remoteUrl));
|
|
11
|
+
return {
|
|
12
|
+
failedHosts: [...hosts].slice(0, 5).join(","),
|
|
13
|
+
failedSamples: failed.slice(0, MAX_SAMPLES).map((item) => `${item.message.slice(0, MAX_MESSAGE_CHARS)} <- ${item.remoteUrl.slice(0, MAX_URL_CHARS)}`).join(" | ")
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function hostOf(url) {
|
|
17
|
+
try {
|
|
18
|
+
return new URL(url).hostname;
|
|
19
|
+
} catch {
|
|
20
|
+
return "invalid-url";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
summarizeImageFailures
|
|
26
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createRequire as __dinoxCreateRequire } from 'node:module';
|
|
2
|
+
const require = __dinoxCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// ../../packages/clip-engine/src/jikeToMarkdown/url.ts
|
|
5
|
+
var POST_ID_RE = /^[0-9a-f]{24}$/i;
|
|
6
|
+
var M_HOST_RE = /^(?:m\.)?okjike\.com$/i;
|
|
7
|
+
var WEB_HOST_RE = /^web\.okjike\.com$/i;
|
|
8
|
+
var SHORT_HOST_RE = /^(?:www\.)?okjk\.co$/i;
|
|
9
|
+
function toUrl(rawUrl) {
|
|
10
|
+
const value = String(rawUrl ?? "").trim().replace(/^["'<]+|["'>]+$/g, "");
|
|
11
|
+
if (!value) return null;
|
|
12
|
+
try {
|
|
13
|
+
const url = new URL(value);
|
|
14
|
+
return url.protocol === "http:" || url.protocol === "https:" ? url : null;
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function canonicalJikeUrl(kind, id) {
|
|
20
|
+
return `https://m.okjike.com/${kind}/${id}`;
|
|
21
|
+
}
|
|
22
|
+
function parseJikeLink(rawUrl) {
|
|
23
|
+
const url = toUrl(rawUrl);
|
|
24
|
+
if (!url) return null;
|
|
25
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
26
|
+
if (segments.length !== 2) return null;
|
|
27
|
+
const [section = "", id = ""] = segments;
|
|
28
|
+
if (!POST_ID_RE.test(id)) return null;
|
|
29
|
+
let kind = null;
|
|
30
|
+
if (M_HOST_RE.test(url.hostname)) {
|
|
31
|
+
if (section === "originalPosts") kind = "originalPosts";
|
|
32
|
+
else if (section === "reposts") kind = "reposts";
|
|
33
|
+
} else if (WEB_HOST_RE.test(url.hostname)) {
|
|
34
|
+
if (section === "originalPost" || section === "originalPosts") kind = "originalPosts";
|
|
35
|
+
else if (section === "repost" || section === "reposts") kind = "reposts";
|
|
36
|
+
}
|
|
37
|
+
if (!kind) return null;
|
|
38
|
+
const normalizedId = id.toLowerCase();
|
|
39
|
+
return { canonicalUrl: canonicalJikeUrl(kind, normalizedId), id: normalizedId, kind };
|
|
40
|
+
}
|
|
41
|
+
function parseJikeShortLink(rawUrl) {
|
|
42
|
+
const url = toUrl(rawUrl);
|
|
43
|
+
if (!url || !SHORT_HOST_RE.test(url.hostname)) return null;
|
|
44
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
45
|
+
if (segments.length !== 1 || !/^[A-Za-z0-9]{3,16}$/.test(segments[0] ?? "")) return null;
|
|
46
|
+
return { shortUrl: `https://okjk.co/${segments[0]}` };
|
|
47
|
+
}
|
|
48
|
+
function isJikeUrl(rawUrl) {
|
|
49
|
+
return parseJikeLink(rawUrl) !== null || parseJikeShortLink(rawUrl) !== null;
|
|
50
|
+
}
|
|
51
|
+
function normalizeJikeUrl(rawUrl) {
|
|
52
|
+
const link = parseJikeLink(rawUrl);
|
|
53
|
+
if (link) return link.canonicalUrl;
|
|
54
|
+
const short = parseJikeShortLink(rawUrl);
|
|
55
|
+
if (short) return short.shortUrl;
|
|
56
|
+
return String(rawUrl ?? "").trim();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
canonicalJikeUrl,
|
|
61
|
+
parseJikeLink,
|
|
62
|
+
parseJikeShortLink,
|
|
63
|
+
isJikeUrl,
|
|
64
|
+
normalizeJikeUrl
|
|
65
|
+
};
|