feat: publish tidgi-shared npm for types, and place tidgi.service

This commit is contained in:
linonetwo 2026-02-09 23:16:49 +08:00
parent 544a8b1bf3
commit 593ed2d29c
10 changed files with 533 additions and 16 deletions

2
packages/tidgi-shared/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
node_modules/
dist/

View file

@ -0,0 +1,45 @@
# tidgi-shared
Shared service interfaces, IPC descriptors, and constants for TidGi plugins.
This package re-exports all TidGi Desktop service interface types so that external TiddlyWiki plugins and projects can reference them without depending on the full TidGi-Desktop codebase.
## Install
```bash
pnpm add tidgi-shared
```
## Usage
```typescript
import type { IGitServerService, IWorkspaceService, IGitService } from 'tidgi-shared';
```
For TiddlyWiki route modules running in TidGi's wiki worker, access services via `$tw.tidgi.service`:
```typescript
import type { IGitServerService, IWorkspaceService, IGitService } from 'tidgi-shared';
interface ITidGiGlobalService {
gitServer?: IGitServerService;
workspace: IWorkspaceService;
git: IGitService;
}
const tidgiService = ($tw as typeof $tw & { tidgi?: { service?: ITidGiGlobalService } }).tidgi?.service;
```
## Building
```bash
pnpm run build
```
## What's Included
- All TidGi service interfaces (25 services)
- IPC descriptors for electron-ipc-cat proxy
- Channel constants for IPC communication
- Shared types (`IService`, `SupportedStorageServices`, etc.)
- Window properties and metadata types

View file

@ -0,0 +1,62 @@
{
"name": "tidgi-shared",
"version": "0.1.1",
"description": "Shared service interfaces and IPC descriptors for TidGi plugins",
"license": "MPL-2.0",
"author": "linonetwo <linonetwo012@gmail.com>",
"homepage": "https://github.com/tiddly-gittly/TidGi-Desktop#readme",
"repository": {
"type": "git",
"url": "https://github.com/tiddly-gittly/TidGi-Desktop.git",
"directory": "packages/tidgi-shared"
},
"bugs": {
"url": "https://github.com/tiddly-gittly/TidGi-Desktop/issues"
},
"keywords": [
"tidgi",
"tiddlywiki",
"plugin",
"ipc",
"service",
"interface",
"types",
"typescript"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"check": "tsc --noEmit",
"prepublishOnly": "pnpm run check && pnpm run build"
},
"dependencies": {
"electron-ipc-cat": "^2.1.0"
},
"peerDependencies": {
"rxjs": ">=7"
},
"peerDependenciesMeta": {
"rxjs": {
"optional": true
}
},
"devDependencies": {
"@types/node": "^22.0.0",
"rxjs": "^7.8.1",
"tsup": "^8.0.0",
"tw5-typed": "^1.1.1",
"type-fest": "^4.0.0",
"typescript": "^5.7.0"
}
}

View file

@ -0,0 +1,47 @@
// Stub declarations for external modules that don't ship their own types
// or whose types are too heavy to include as dependencies.
declare module 'v8-compile-cache-lib' {
export const __TEST__: any;
export function install(options?: any): { uninstall: () => void } | undefined;
export function uninstall(): void;
}
declare module 'espree' {
export function parse(code: string, options?: any): any;
export function tokenize(code: string, options?: any): any;
export const version: string;
export const latestEcmaVersion: number;
export const supportedEcmaVersions: number[];
}
declare module 'git-sync-js' {
export interface ICommitAndSyncOptions {
[key: string]: unknown;
}
export interface ModifiedFileList {
filePath: string;
fileRelativePath: string;
type: string;
}
}
declare module 'ai' {
export interface ModelMessage {
role: string;
content: string | Array<{ type: string; [key: string]: unknown }>;
[key: string]: unknown;
}
}
declare module 'typeorm' {
export function Entity(name?: string): ClassDecorator;
export function Column(options?: Record<string, unknown>): PropertyDecorator;
export function PrimaryColumn(): PropertyDecorator;
export function Index(): PropertyDecorator;
export function CreateDateColumn(): PropertyDecorator;
export function UpdateDateColumn(): PropertyDecorator;
export class DataSource {
[key: string]: unknown;
}
}

View file

@ -0,0 +1,49 @@
/**
* tidgi-shared Shared service interfaces and IPC descriptors for TidGi plugins.
*
* This package re-exports all TidGi Desktop service interface types, IPC descriptors,
* and shared constants so that external TiddlyWiki plugins and projects can reference
* them without depending on the full TidGi-Desktop codebase.
*/
// ── Constants ──────────────────────────────────────────────────────────────────
export * from '@/constants/channels';
export * from '@/constants/pageTypes';
export * from '@/constants/wikiCreation';
export * from '@/constants/auth';
// ── Shared Service Types ───────────────────────────────────────────────────────
export * from '@services/types';
export { default as serviceIdentifier } from '@services/serviceIdentifier';
// ── Service Interfaces ─────────────────────────────────────────────────────────
// Each re-export includes the interface, IPC descriptor, and associated types.
export * from '@services/agentBrowser/interface';
export * from '@services/agentDefinition/interface';
export * from '@services/agentInstance/interface';
export * from '@services/auth/interface';
export * from '@services/context/interface';
export * from '@services/database/interface';
export * from '@services/deepLink/interface';
export * from '@services/externalAPI/interface';
export * from '@services/git/interface';
export * from '@services/gitServer/interface';
export * from '@services/menu/interface';
export * from '@services/native/interface';
export * from '@services/notifications/interface';
export * from '@services/preferences/interface';
export * from '@services/sync/interface';
export * from '@services/systemPreferences/interface';
export * from '@services/theme/interface';
export * from '@services/updater/interface';
export * from '@services/view/interface';
export * from '@services/wiki/interface';
export * from '@services/wikiEmbedding/interface';
export * from '@services/wikiGitWorkspace/interface';
export * from '@services/windows/interface';
export * from '@services/workspaces/interface';
export * from '@services/workspacesView/interface';
// ── Window Properties (widely referenced) ──────────────────────────────────────
export * from '@services/windows/WindowProperties';

View file

@ -0,0 +1,29 @@
{
"compilerOptions": {
"baseUrl": "../../",
"paths": {
"@services/*": ["./src/services/*"],
"@/*": ["./src/*"]
},
"target": "ES2021",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ESNext"],
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist",
"strict": true,
"strictNullChecks": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": ["tw5-typed"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "dist"]
}

View file

@ -0,0 +1,41 @@
import path from 'path';
import { defineConfig } from 'tsup';
const srcRoot = path.resolve(__dirname, '../../src');
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: {
// Allow DTS generation to continue even with errors from upstream source files
// that rely on more precise type stubs (e.g. tiddlywiki boot.files indexing)
compilerOptions: {
skipLibCheck: true,
noImplicitAny: false,
},
},
splitting: false,
sourcemap: true,
clean: true,
treeshake: true,
esbuildOptions(options) {
options.alias = {
'@services': path.join(srcRoot, 'services'),
'@': srcRoot,
};
},
// Don't bundle these — consumers provide them or they're type-only
external: [
'rxjs',
'electron-ipc-cat',
'electron-ipc-cat/common',
'electron',
'typeorm',
'tiddlywiki',
'ai',
'git-sync-js',
'type-fest',
'zod',
'zod/v4',
],
});

257
pnpm-lock.yaml generated
View file

@ -476,6 +476,31 @@ importers:
specifier: 5.1.0
version: 5.1.0(bluebird@3.7.2)
packages/tidgi-shared:
dependencies:
electron-ipc-cat:
specifier: ^2.1.0
version: 2.2.3(electron@39.2.3)(rxjs@7.8.2)
devDependencies:
'@types/node':
specifier: ^22.0.0
version: 22.19.1
rxjs:
specifier: ^7.8.1
version: 7.8.2
tsup:
specifier: ^8.0.0
version: 8.5.1(@swc/core@1.12.0)(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.9.3)(yaml@2.8.1)
tw5-typed:
specifier: ^1.1.1
version: 1.1.1
type-fest:
specifier: ^4.0.0
version: 4.41.0
typescript:
specifier: ^5.7.0
version: 5.9.3
packages:
'@0no-co/graphql.web@1.2.0':
@ -3347,6 +3372,12 @@ packages:
resolution: {integrity: sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg==}
engines: {node: '>=18.20'}
bundle-require@5.1.0:
resolution: {integrity: sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
peerDependencies:
esbuild: '>=0.18'
bytes@3.1.2:
resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==}
engines: {node: '>= 0.8'}
@ -3422,6 +3453,10 @@ packages:
resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==}
engines: {node: '>= 16'}
chokidar@4.0.3:
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
engines: {node: '>= 14.16.0'}
chownr@1.1.4:
resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
@ -3546,6 +3581,10 @@ packages:
commander@2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
commander@4.1.1:
resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
engines: {node: '>= 6'}
commander@5.1.0:
resolution: {integrity: sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==}
engines: {node: '>= 6'}
@ -3565,6 +3604,13 @@ packages:
concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
confbox@0.1.8:
resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==}
consola@3.4.2:
resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==}
engines: {node: ^14.18.0 || >=16.10.0}
content-disposition@1.0.1:
resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==}
engines: {node: '>=18'}
@ -4479,6 +4525,9 @@ packages:
resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
engines: {node: '>=10'}
fix-dts-default-cjs-exports@1.0.1:
resolution: {integrity: sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==}
flat-cache@4.0.1:
resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==}
engines: {node: '>=16'}
@ -4644,11 +4693,13 @@ packages:
glob@10.5.0:
resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==}
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
hasBin: true
glob@11.1.0:
resolution: {integrity: sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==}
engines: {node: 20 || >=22}
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
hasBin: true
glob@13.0.0:
@ -4657,12 +4708,12 @@ packages:
glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
deprecated: Glob versions prior to v9 are no longer supported
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
glob@8.1.0:
resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
engines: {node: '>=12'}
deprecated: Glob versions prior to v9 are no longer supported
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
global-agent@3.0.0:
resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==}
@ -5149,6 +5200,10 @@ packages:
jose@6.1.2:
resolution: {integrity: sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ==}
joycon@3.1.1:
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
jpeg-js@0.4.4:
resolution: {integrity: sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==}
@ -5618,6 +5673,9 @@ packages:
engines: {node: '>=10'}
hasBin: true
mlly@1.8.0:
resolution: {integrity: sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==}
moment@2.30.1:
resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}
@ -6047,10 +6105,17 @@ packages:
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'}
pirates@4.0.7:
resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==}
engines: {node: '>= 6'}
pixelmatch@5.3.0:
resolution: {integrity: sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==}
hasBin: true
pkg-types@1.3.1:
resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==}
playwright-core@1.56.1:
resolution: {integrity: sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==}
engines: {node: '>=18'}
@ -6081,6 +6146,24 @@ packages:
resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==}
engines: {node: '>= 0.4'}
postcss-load-config@6.0.1:
resolution: {integrity: sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==}
engines: {node: '>= 18'}
peerDependencies:
jiti: '>=1.21.0'
postcss: '>=8.0.9'
tsx: ^4.8.1
yaml: ^2.4.2
peerDependenciesMeta:
jiti:
optional: true
postcss:
optional: true
tsx:
optional: true
yaml:
optional: true
postcss-value-parser@4.2.0:
resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==}
@ -6328,6 +6411,10 @@ packages:
resolution: {integrity: sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw==}
engines: {node: '>=8'}
readdirp@4.1.2:
resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
engines: {node: '>= 14.18.0'}
rechoir@0.8.0:
resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==}
engines: {node: '>= 10.13.0'}
@ -6399,6 +6486,10 @@ packages:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
resolve-from@5.0.0:
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
engines: {node: '>=8'}
resolve-pkg-maps@1.0.0:
resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
@ -6706,6 +6797,10 @@ packages:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
source-map@0.7.6:
resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==}
engines: {node: '>= 12'}
spdx-correct@3.2.0:
resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==}
@ -6904,6 +6999,11 @@ packages:
stylis@4.3.2:
resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==}
sucrase@3.35.1:
resolution: {integrity: sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==}
engines: {node: '>=16 || 14 >=14.17'}
hasBin: true
sumchecker@3.0.1:
resolution: {integrity: sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==}
engines: {node: '>= 8.0'}
@ -6948,12 +7048,12 @@ packages:
tar@6.2.1:
resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
engines: {node: '>=10'}
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting i@izs.me
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
tar@7.5.2:
resolution: {integrity: sha512-7NyxrTE4Anh8km8iEy7o0QYPs+0JKBTj5ZaqHg6B39erLg0qYXN3BijtShwbsNSvQ+LN75+KV+C4QR/f6Gwnpg==}
engines: {node: '>=18'}
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exhorbitant rates) by contacting i@izs.me
deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
temp@0.9.4:
resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==}
@ -7085,6 +7185,10 @@ packages:
resolution: {integrity: sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==}
engines: {node: '>=20'}
tree-kill@1.2.2:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
trim-repeated@1.0.0:
resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==}
engines: {node: '>=0.10.0'}
@ -7114,6 +7218,9 @@ packages:
resolution: {integrity: sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==}
engines: {node: '>=6.10'}
ts-interface-checker@0.1.13:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
ts-node@10.9.2:
resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
hasBin: true
@ -7143,6 +7250,25 @@ packages:
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tsup@8.5.1:
resolution: {integrity: sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==}
engines: {node: '>=18'}
hasBin: true
peerDependencies:
'@microsoft/api-extractor': ^7.36.0
'@swc/core': ^1
postcss: ^8.4.12
typescript: '>=4.5.0'
peerDependenciesMeta:
'@microsoft/api-extractor':
optional: true
'@swc/core':
optional: true
postcss:
optional: true
typescript:
optional: true
tsutils@3.21.0:
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
engines: {node: '>= 6'}
@ -7297,6 +7423,9 @@ packages:
engines: {node: ^18.20.0 || ^20.10.0 || >=22.0.0}
hasBin: true
ufo@1.6.3:
resolution: {integrity: sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==}
unbox-primitive@1.1.0:
resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==}
engines: {node: '>= 0.4'}
@ -10119,7 +10248,7 @@ snapshots:
'@types/better-sqlite3@7.6.13':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/bluebird@3.5.42': {}
@ -10127,7 +10256,7 @@ snapshots:
dependencies:
'@types/http-cache-semantics': 4.0.4
'@types/keyv': 3.1.4
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/responselike': 1.0.3
'@types/chai@5.2.3':
@ -10171,11 +10300,11 @@ snapshots:
'@types/fs-extra@11.0.4':
dependencies:
'@types/jsonfile': 6.1.4
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/fs-extra@9.0.13':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
optional: true
'@types/har-format@1.2.16': {}
@ -10192,7 +10321,7 @@ snapshots:
'@types/intercept-stdout@0.1.4':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/json-schema@7.0.15': {}
@ -10200,17 +10329,17 @@ snapshots:
'@types/jsonfile@6.1.4':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/keyv@3.1.4':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/lodash@4.17.20': {}
'@types/mute-stream@0.0.4':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/node@16.9.1': {}
@ -10261,7 +10390,7 @@ snapshots:
'@types/responselike@1.0.3':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
'@types/semver@7.7.1': {}
@ -10293,7 +10422,7 @@ snapshots:
'@types/yauzl@2.10.3':
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
optional: true
'@typescript-eslint/eslint-plugin@8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.1(jiti@2.6.1))(typescript@5.9.3)':
@ -11156,6 +11285,11 @@ snapshots:
builtin-modules@5.0.0: {}
bundle-require@5.1.0(esbuild@0.27.0):
dependencies:
esbuild: 0.27.0
load-tsconfig: 0.2.5
bytes@3.1.2: {}
cac@6.7.14: {}
@ -11269,6 +11403,10 @@ snapshots:
check-error@2.1.1: {}
chokidar@4.0.3:
dependencies:
readdirp: 4.1.2
chownr@1.1.4: {}
chownr@2.0.0: {}
@ -11370,6 +11508,8 @@ snapshots:
commander@2.20.3: {}
commander@4.1.1: {}
commander@5.1.0: {}
commander@9.1.0: {}
@ -11380,6 +11520,10 @@ snapshots:
concat-map@0.0.1: {}
confbox@0.1.8: {}
consola@3.4.2: {}
content-disposition@1.0.1: {}
content-type@1.0.5: {}
@ -12624,6 +12768,12 @@ snapshots:
locate-path: 6.0.0
path-exists: 4.0.0
fix-dts-default-cjs-exports@1.0.1:
dependencies:
magic-string: 0.30.21
mlly: 1.8.0
rollup: 4.53.3
flat-cache@4.0.1:
dependencies:
flatted: 3.3.3
@ -13346,7 +13496,7 @@ snapshots:
jest-worker@27.5.1:
dependencies:
'@types/node': 24.10.1
'@types/node': 22.19.1
merge-stream: 2.0.0
supports-color: 8.1.1
@ -13384,6 +13534,8 @@ snapshots:
jose@6.1.2: {}
joycon@3.1.1: {}
jpeg-js@0.4.4: {}
js-tokens@4.0.0: {}
@ -13849,6 +14001,13 @@ snapshots:
mkdirp@3.0.1: {}
mlly@1.8.0:
dependencies:
acorn: 8.15.0
pathe: 2.0.3
pkg-types: 1.3.1
ufo: 1.6.3
moment@2.30.1: {}
monaco-editor@0.55.1:
@ -14265,10 +14424,18 @@ snapshots:
pify@2.3.0: {}
pirates@4.0.7: {}
pixelmatch@5.3.0:
dependencies:
pngjs: 6.0.0
pkg-types@1.3.1:
dependencies:
confbox: 0.1.8
mlly: 1.8.0
pathe: 2.0.3
playwright-core@1.56.1: {}
playwright@1.56.1:
@ -14291,6 +14458,15 @@ snapshots:
possible-typed-array-names@1.1.0: {}
postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.6)(yaml@2.8.1):
dependencies:
lilconfig: 3.1.3
optionalDependencies:
jiti: 2.6.1
postcss: 8.5.6
tsx: 4.20.6
yaml: 2.8.1
postcss-value-parser@4.2.0: {}
postcss@8.4.49:
@ -14544,6 +14720,8 @@ snapshots:
dependencies:
readable-stream: 4.7.0
readdirp@4.1.2: {}
rechoir@0.8.0:
dependencies:
resolve: 1.22.11
@ -14612,6 +14790,8 @@ snapshots:
resolve-from@4.0.0: {}
resolve-from@5.0.0: {}
resolve-pkg-maps@1.0.0: {}
resolve-protobuf-schema@2.1.0:
@ -14984,6 +15164,8 @@ snapshots:
source-map@0.6.1: {}
source-map@0.7.6: {}
spdx-correct@3.2.0:
dependencies:
spdx-expression-parse: 3.0.1
@ -15196,6 +15378,16 @@ snapshots:
stylis@4.3.2: {}
sucrase@3.35.1:
dependencies:
'@jridgewell/gen-mapping': 0.3.13
commander: 4.1.1
lines-and-columns: 1.2.4
mz: 2.7.0
pirates: 4.0.7
tinyglobby: 0.2.15
ts-interface-checker: 0.1.13
sumchecker@3.0.1:
dependencies:
debug: 4.4.3(supports-color@8.1.1)
@ -15384,6 +15576,8 @@ snapshots:
dependencies:
punycode: 2.3.1
tree-kill@1.2.2: {}
trim-repeated@1.0.0:
dependencies:
escape-string-regexp: 1.0.5
@ -15405,6 +15599,8 @@ snapshots:
ts-dedent@2.2.0: {}
ts-interface-checker@0.1.13: {}
ts-node@10.9.2(@swc/core@1.12.0)(@types/node@24.10.1)(typescript@5.9.3):
dependencies:
'@cspotcode/source-map-support': 0.8.1
@ -15440,6 +15636,35 @@ snapshots:
tslib@2.8.1: {}
tsup@8.5.1(@swc/core@1.12.0)(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.6)(typescript@5.9.3)(yaml@2.8.1):
dependencies:
bundle-require: 5.1.0(esbuild@0.27.0)
cac: 6.7.14
chokidar: 4.0.3
consola: 3.4.2
debug: 4.4.3(supports-color@8.1.1)
esbuild: 0.27.0
fix-dts-default-cjs-exports: 1.0.1
joycon: 3.1.1
picocolors: 1.1.1
postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@4.20.6)(yaml@2.8.1)
resolve-from: 5.0.0
rollup: 4.53.3
source-map: 0.7.6
sucrase: 3.35.1
tinyexec: 0.3.2
tinyglobby: 0.2.15
tree-kill: 1.2.2
optionalDependencies:
'@swc/core': 1.12.0
postcss: 8.5.6
typescript: 5.9.3
transitivePeerDependencies:
- jiti
- supports-color
- tsx
- yaml
tsutils@3.21.0(typescript@5.9.3):
dependencies:
tslib: 1.14.1
@ -15583,6 +15808,8 @@ snapshots:
transitivePeerDependencies:
- supports-color
ufo@1.6.3: {}
unbox-primitive@1.1.0:
dependencies:
call-bound: 1.0.4

2
pnpm-workspace.yaml Normal file
View file

@ -0,0 +1,2 @@
packages:
- packages/*

View file

@ -1,6 +1,6 @@
// Auto-attach services to global.service - MUST import before using services
import './services';
import { native } from './services';
import { native, service } from './services';
import { onWorkerServicesReady } from './servicesReady';
import { getTidGiAuthHeaderWithToken } from '@/constants/auth';
@ -222,6 +222,19 @@ export function startNodeJSWiki(configs: IStartNodeJSWikiConfigs): Observable<IW
: [homePath, '--version'];
wikiInstance.boot.argv = [...fullBootArgv];
/**
* Attach service proxies to `$tw.tidgi.service` so that TiddlyWiki route modules
* (which run in vm.runInContext sandbox) can access them.
* The sandbox injects `$tw` but NOT `globalThis` or `global`,
* so `$tw.tidgi.service` is the only way for plugins to reach IPC service proxies.
*/
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
if (!(wikiInstance as any).tidgi) {
(wikiInstance as any).tidgi = {};
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
(wikiInstance as any).tidgi.service = service;
wikiInstance.hooks.addHook('th-server-command-post-start', function(_server: unknown, nodeServer: Server) {
nodeServer.on('error', function(error: Error) {
observer.next({ type: 'control', actions: WikiControlActions.error, message: error.message, argv: fullBootArgv });