TidGi-Desktop/packages/tidgi-shared
linonetwo 541f351428 feat: integrate memeloop runtime into TidGi-Desktop (#desktop-integrate-memeloop)
- Rename src/services/externalAPI/ → src/services/providerRegistry/
- Service identifier: ExternalAPI → ProviderRegistry
- Backward compat maintained: renderer still accesses via window.service.externalAPI
- IPC channel name unchanged for wire compatibility
- Enhanced interface with generateFromAI(), generateSpeech(), generateImage() etc.
- Added BehaviorSubject observables (defaultConfig$, providers$)
- Added auto-fill logic for default models, API call logging, retry utility

- New memeloopWorker.ts: runs MemeLoopRuntime in Node.js worker thread
- New memeloopWorkerFactory.ts: Vite ?nodeWorker bundling
- New terminal/sessionManager.ts: interactive shell session management for agent tools
- AgentInstanceService: added memeloopTaskAgentWorkerHandler framework
  - Worker conversation lifecycle: ensure/bind/cleanup/cancel
  - Bidirectional sync: worker updates → main DB → renderer
  - ask-question and tool-approval event routing
- tools/zxScript.ts: added terminal-execute/follow/respond/cancel/list tools

- Import Theme from @memeloop/prompt-editor/web
- Merge base templates/widgets with TidGi custom overrides
- Re-export ConditionalFieldConfig from shared package

- Fix race condition in NewTabContent.tsx: await closeTab() before addTab()
  to prevent concurrent zustand state updates that lose activeTabId
- Same fix applied in AgentsPlugin.tsx onSelect handler
- ChatTabContent: keep input enabled during agent fetch to avoid MUI disabled
  rendering differences that break E2E selectors
- Revert InputContainer.tsx slotProps→inputProps regression (keep MUI v6 API)

- Added: memeloop, memeloop-node, @memeloop/protocol, @memeloop/prompt-editor (linked)

- Unit tests: 59 files, 499 tests passed
- E2E @agent: 8 scenarios passed
- E2E @agentTool: 3 scenarios passed
- E2E @newAgent + @editAgentDefinition: 2 scenarios passed"
2026-04-04 02:15:31 +08:00
..
src feat: integrate memeloop runtime into TidGi-Desktop (#desktop-integrate-memeloop) 2026-04-04 02:15:31 +08:00
.gitignore feat: publish tidgi-shared npm for types, and place tidgi.service 2026-02-09 23:16:49 +08:00
package.json Fix/misc bug (#691) 2026-04-01 15:45:26 +08:00
README.md Fix/misc bug (#691) 2026-04-01 15:45:26 +08:00
tsconfig.json Expose TidGi services to $tw.tidgi and add types 2026-02-10 02:41:32 +08:00
tsup.config.ts feat: publish tidgi-shared npm for types, and place tidgi.service 2026-02-09 23:16:49 +08:00

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

pnpm add tidgi-shared

Usage

import type { IGitServerService, IGitService, ITidGiGlobalService, IWorkspaceService } from 'tidgi-shared';

For TiddlyWiki route modules running in TidGi's wiki worker, access services via $tw.tidgi.service:

import type { IGitServerService, IGitService, ITidGiGlobalService, IWorkspaceService } from 'tidgi-shared';

const tidgiService = ($tw as typeof $tw & { tidgi?: { service?: ITidGiGlobalService } }).tidgi?.service;

Building

pnpm run build

Releasing

tidgi-shared is built from the live interfaces in TidGi-Desktop/src via the aliases in tsup.config.ts, so release it only after the upstream service interfaces are already updated.

  1. Update the source interfaces in TidGi-Desktop/src/services/**/interface.ts.
  2. Bump the version in packages/tidgi-shared/package.json.
  3. From the TidGi-Desktop repo root, run:
pnpm --filter tidgi-shared run check
pnpm --filter tidgi-shared run build
  1. Optionally verify the tarball contents before publishing:
cd packages/tidgi-shared
npm pack --dry-run
  1. Publish from packages/tidgi-shared:
npm publish --access public
  1. Verify the published version:
npm view tidgi-shared version

If a plugin starts using a new TidGi service method and TypeScript cannot see it yet, that usually means the desktop source was updated but tidgi-shared has not been republished since that interface change.

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