universal-plugin-hub 1.3.1 → 1.5.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/README.md +14 -2
- package/README.zh.md +14 -2
- package/client/client.js +2597 -357
- package/package.json +1 -1
- package/src/at-plugins.js +823 -0
- package/src/icons.js +7 -0
- package/src/index.js +18 -0
- package/src/install.js +3415 -3088
- package/src/market.js +71 -46
- package/src/oauth-bridge.js +0 -1
- package/src/oauth-config.js +4 -0
- package/src/oauth-store.js +24 -11
- package/src/oauth.js +3 -3
- package/src/parser.js +31 -8
- package/src/routes.js +58 -26
- package/src/runtime.js +3 -1
- package/src/skills.js +4 -4
- package/src/store.js +93 -15
package/src/icons.js
CHANGED
|
@@ -22,6 +22,7 @@ const bundledPending = new Map()
|
|
|
22
22
|
const localIconMemory = new Map()
|
|
23
23
|
const localIconPending = new Map()
|
|
24
24
|
let localIconMemoryBytes = 0
|
|
25
|
+
let localIconCacheRevisionCounter = 0
|
|
25
26
|
const bundledIconRoot = new URL('../assets/fluent-3d/', import.meta.url)
|
|
26
27
|
const bundledIconFiles = new Map(Object.values(JSON.parse(readFileSync(new URL('manifest.json', bundledIconRoot), 'utf8')).icons).map(icon => [icon.url, icon.file]))
|
|
27
28
|
|
|
@@ -135,8 +136,14 @@ export async function readLocalIconCached(root, path, scopeParts = []) {
|
|
|
135
136
|
try { return await task } finally { localIconPending.delete(key) }
|
|
136
137
|
}
|
|
137
138
|
|
|
139
|
+
/** Monotonic counter incremented when cached local icons are invalidated. */
|
|
140
|
+
export function localIconCacheRevision() {
|
|
141
|
+
return localIconCacheRevisionCounter
|
|
142
|
+
}
|
|
143
|
+
|
|
138
144
|
/** Drop cached local icon bytes for one sourceId (or all entries when omitted). */
|
|
139
145
|
export function invalidateLocalIconCache(sourceId) {
|
|
146
|
+
localIconCacheRevisionCounter += 1
|
|
140
147
|
if (!sourceId) {
|
|
141
148
|
localIconMemory.clear()
|
|
142
149
|
localIconMemoryBytes = 0
|
package/src/index.js
CHANGED
|
@@ -14,6 +14,12 @@ import { sweepTrash } from './store.js'
|
|
|
14
14
|
import { restoreUploadedSkills } from './skill-uploads.js'
|
|
15
15
|
import { removeDuplicateLocalMarketTabs } from './local.js'
|
|
16
16
|
import { createProfileApplicator } from './runtime.js'
|
|
17
|
+
import {
|
|
18
|
+
attachAtPluginsAgentHook,
|
|
19
|
+
attachAtPluginsSessionTitleHook,
|
|
20
|
+
atPluginsBootPayload,
|
|
21
|
+
invalidateAtPluginsCache,
|
|
22
|
+
} from './at-plugins.js'
|
|
17
23
|
import { createRequire } from 'node:module'
|
|
18
24
|
import { join } from 'node:path'
|
|
19
25
|
|
|
@@ -43,6 +49,7 @@ export function apply(ctx) {
|
|
|
43
49
|
if (removed.length) ctx.logger?.info?.(`[universal-plugin-hub] removed duplicate local tabs: ${removed.join(', ')}`)
|
|
44
50
|
|
|
45
51
|
await syncAllInstalledSkillsToDsh()
|
|
52
|
+
invalidateAtPluginsCache()
|
|
46
53
|
} catch (err) {
|
|
47
54
|
ctx.logger?.warn?.(`[universal-plugin-hub] skill sync error: ${err.message}`)
|
|
48
55
|
}
|
|
@@ -81,6 +88,12 @@ export function apply(ctx) {
|
|
|
81
88
|
}
|
|
82
89
|
hostCtx.effect(() => skills.attachAgents(hostCtx, createScope), 'universal-plugin-hub: scoped skill switches')
|
|
83
90
|
})
|
|
91
|
+
ctx.inject(['agents'], (hostCtx) => {
|
|
92
|
+
hostCtx.effect(() => attachAtPluginsAgentHook(hostCtx), 'universal-plugin-hub: @ plugins routing')
|
|
93
|
+
})
|
|
94
|
+
ctx.inject(['sessions'], (hostCtx) => {
|
|
95
|
+
hostCtx.effect(() => attachAtPluginsSessionTitleHook(hostCtx), 'universal-plugin-hub: @ plugins session title')
|
|
96
|
+
})
|
|
84
97
|
ctx.inject(['webServer'], (hostCtx) => {
|
|
85
98
|
hostCtx.effect(() => {
|
|
86
99
|
const unmount = mountRoutes(hostCtx.webServer, skills, createProfileApplicator(ctx))
|
|
@@ -99,6 +112,11 @@ export function apply(ctx) {
|
|
|
99
112
|
} catch (error) {
|
|
100
113
|
ctx.logger?.warn?.(`[universal-plugin-hub] MCP tool icon boot data unavailable: ${error.message}`)
|
|
101
114
|
}
|
|
115
|
+
try {
|
|
116
|
+
table.push({ kind: 'global', name: '__UPH_AT_PLUGINS__', value: atPluginsBootPayload() })
|
|
117
|
+
} catch (error) {
|
|
118
|
+
ctx.logger?.warn?.(`[universal-plugin-hub] @ plugins boot data unavailable: ${error.message}`)
|
|
119
|
+
}
|
|
102
120
|
})
|
|
103
121
|
return () => { offBoot?.(); unmount(); cancelAllOAuthVerifications() }
|
|
104
122
|
}, 'universal-plugin-hub: http routes')
|