MCPcopy Create free account
hub / github.com/MemTensor/MemOS / fetchHubSkillBundle

Function fetchHubSkillBundle

packages/memos-core/src/client/skill-sync.ts:106–115  ·  view source on GitHub ↗
(
  store: SqliteStore,
  ctx: PluginContext,
  input: { skillId: string; hubAddress?: string; userToken?: string },
)

Source from the content-addressed store, hash-verified

104}
105
106export async function fetchHubSkillBundle(
107 store: SqliteStore,
108 ctx: PluginContext,
109 input: { skillId: string; hubAddress?: string; userToken?: string },
110): Promise<SkillBundle & { skillId: string }> {
111 const client = await resolveHubClient(store, ctx, { hubAddress: input.hubAddress, userToken: input.userToken });
112 return hubRequestJson(client.hubUrl, client.userToken, `/api/v1/hub/skills/${encodeURIComponent(input.skillId)}/bundle`, {
113 method: "GET",
114 }) as Promise<SkillBundle & { skillId: string }>;
115}
116
117export function restoreSkillBundleFromHub(
118 store: SqliteStore,

Callers 1

Calls 2

resolveHubClientFunction · 0.90
hubRequestJsonFunction · 0.90

Tested by

no test coverage detected