@aexol/opencode-wizard 0.3.8 → 0.3.10

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.
@@ -1,14 +1,15 @@
1
1
  import { type PublishedSkillDetail, type PublishedSkillsSuccessState } from '../published-skills-transform.js';
2
2
  import type { AiFacingPluginStatusSnapshot, AuthState, FilteredPublishedSkillsResult, LoginBootstrapSnapshot, PluginAuthStateSummary, PluginStatusSnapshot, PublishedSkillCatalogPayload, PublishedSkillsResult, ResolvedConfig } from './types.js';
3
- export declare const toPublishedSkillCatalog: (payload: PublishedSkillCatalogPayload) => PublishedSkillsSuccessState;
3
+ export declare const toPublishedSkillCatalog: (payload: PublishedSkillCatalogPayload, availableTools?: string[]) => PublishedSkillsSuccessState;
4
4
  export declare const filterIgnoredPublishedSkills: (config: ResolvedConfig, result: PublishedSkillsResult) => Promise<FilteredPublishedSkillsResult>;
5
5
  export declare const buildSystemNote: (result: PublishedSkillsResult, _config: ResolvedConfig, details: PublishedSkillDetail[]) => string | null;
6
6
  export declare const formatStatusOutput: (worktree: string, config: ResolvedConfig, publishedSkillsResult: PublishedSkillsResult, loginBootstrapSnapshot: LoginBootstrapSnapshot) => Promise<string>;
7
7
  export declare const toPluginAuthStateSummary: (authState: AuthState | null) => PluginAuthStateSummary;
8
- export declare const resolvePluginStatusSnapshot: ({ worktree, directory, signal, }: {
8
+ export declare const resolvePluginStatusSnapshot: ({ worktree, directory, signal, registeredTools, }: {
9
9
  worktree: string;
10
10
  directory: string;
11
11
  signal: AbortSignal;
12
+ registeredTools?: string[];
12
13
  }) => Promise<PluginStatusSnapshot>;
13
14
  export declare const withStatusMessage: (snapshot: PluginStatusSnapshot, message: string) => PluginStatusSnapshot;
14
15
  export declare const toAiFacingPluginStatusSnapshot: (snapshot: PluginStatusSnapshot) => AiFacingPluginStatusSnapshot;
@@ -1,4 +1,4 @@
1
- import { AVAILABLE_PUBLISHED_SKILL_TOOLS, resolveAvailableTools } from '../plugin-tools.js';
1
+ import { resolveAvailableTools } from '../plugin-tools.js';
2
2
  import { buildPublishedSkillsSystemNote } from '../published-skills-system-note.js';
3
3
  import { toPublishedSkillCatalog as buildPublishedSkillCatalog, toInstallableSkillSummary, toPublishedSkillSummary } from '../published-skills-transform.js';
4
4
  import { readGlobalAuthState, resolveStoredAuthState, toStoredUserKey } from './auth-store.js';
@@ -6,10 +6,10 @@ import { fetchPublishedSkillsCatalog } from './client.js';
6
6
  import { NATIVE_SKILLS_URL_COMPATIBILITY, PLUGIN_ID, ROOT_SKILL_SEED_PATH } from './constants.js';
7
7
  import { resolveConfig } from './config.js';
8
8
  import { getPublishedSkillIgnoreScopeKey, resolveWorkspace, toWorkspaceResolutionMetadata, toWorkspaceResolutionOutput } from './workspace.js';
9
- export const toPublishedSkillCatalog = payload => buildPublishedSkillCatalog(payload, {
9
+ export const toPublishedSkillCatalog = (payload, availableTools = resolveAvailableTools(null)) => buildPublishedSkillCatalog(payload, {
10
10
  pluginId: PLUGIN_ID,
11
11
  rootSkillSeedPath: ROOT_SKILL_SEED_PATH,
12
- availableTools: AVAILABLE_PUBLISHED_SKILL_TOOLS
12
+ availableTools
13
13
  });
14
14
  export const filterIgnoredPublishedSkills = async (config, result) => {
15
15
  const authState = await readGlobalAuthState(config.authStatePath);
@@ -105,7 +105,7 @@ export const formatStatusOutput = async (worktree, config, publishedSkillsResult
105
105
  }
106
106
  return JSON.stringify({
107
107
  ...base,
108
- ...toPublishedSkillCatalog(filteredResult.fetchResult.payload),
108
+ ...toPublishedSkillCatalog(filteredResult.fetchResult.payload, base.availableTools),
109
109
  message: getWorkspaceUnavailableMessage(filteredResult.fetchResult.payload)
110
110
  }, null, 2);
111
111
  };
@@ -132,7 +132,8 @@ export const toPluginAuthStateSummary = authState => {
132
132
  export const resolvePluginStatusSnapshot = async ({
133
133
  worktree,
134
134
  directory,
135
- signal
135
+ signal,
136
+ registeredTools
136
137
  }) => {
137
138
  const config = await resolveConfig(worktree);
138
139
  const workspaceResolution = await resolveWorkspace({
@@ -146,6 +147,7 @@ export const resolvePluginStatusSnapshot = async ({
146
147
  fetchResult
147
148
  });
148
149
  const authState = await resolveStoredAuthState(worktree, config);
150
+ const availableTools = registeredTools ?? resolveAvailableTools(authState?.role ?? null);
149
151
  return {
150
152
  pluginId: PLUGIN_ID,
151
153
  runtimeMode: 'tool_fetch_only',
@@ -161,9 +163,9 @@ export const resolvePluginStatusSnapshot = async ({
161
163
  authMode: filteredResult.fetchResult.authMode,
162
164
  fetchedAt: filteredResult.fetchResult.fetchedAt,
163
165
  source: filteredResult.fetchResult.source,
164
- availableTools: resolveAvailableTools(authState?.role ?? null),
166
+ availableTools,
165
167
  message: filteredResult.fetchResult.ok ? getWorkspaceUnavailableMessage(filteredResult.fetchResult.payload) : filteredResult.fetchResult.message,
166
- catalog: filteredResult.fetchResult.ok ? toPublishedSkillCatalog(filteredResult.fetchResult.payload) : null,
168
+ catalog: filteredResult.fetchResult.ok ? toPublishedSkillCatalog(filteredResult.fetchResult.payload, availableTools) : null,
167
169
  installableCatalog: filteredResult.fetchResult.ok ? {
168
170
  count: filteredResult.fetchResult.payload.catalogSkills.length,
169
171
  skills: filteredResult.fetchResult.payload.catalogSkills.map(toInstallableSkillSummary)
@@ -1 +1 @@
1
- {"version":3,"names":["AVAILABLE_PUBLISHED_SKILL_TOOLS","resolveAvailableTools","buildPublishedSkillsSystemNote","toPublishedSkillCatalog","buildPublishedSkillCatalog","toInstallableSkillSummary","toPublishedSkillSummary","readGlobalAuthState","resolveStoredAuthState","toStoredUserKey","fetchPublishedSkillsCatalog","NATIVE_SKILLS_URL_COMPATIBILITY","PLUGIN_ID","ROOT_SKILL_SEED_PATH","resolveConfig","getPublishedSkillIgnoreScopeKey","resolveWorkspace","toWorkspaceResolutionMetadata","toWorkspaceResolutionOutput","payload","pluginId","rootSkillSeedPath","availableTools","filterIgnoredPublishedSkills","config","result","authState","authStatePath","userKey","fetchResult","ok","ignoreState","scopeKey","workspaceResolution","ignoredSkillSlugs","installedGlobalSkillSlugs","installedWorkspaceSkillSlugs","ignoredSkills","userPreferences","map","skill","skillSlug","getWorkspaceUnavailableMessage","workspace","buildSystemNote","_config","details","catalog","directoryPath","formatStatusOutput","worktree","publishedSkillsResult","loginBootstrapSnapshot","filteredResult","base","runtimeMode","nativeSkillsUrlCompatibility","backendOrigin","graphqlUrl","fallbackWorkspaceSlug","requestedDirectoryPath","authMode","email","userId","role","authenticatedAt","expiresAt","loginBootstrap","status","trigger","startedAt","browserUrl","browserOpenError","message","fetchedAt","source","ignoredPublishedSkills","count","length","JSON","stringify","toPluginAuthStateSummary","resolvePluginStatusSnapshot","directory","signal","installableCatalog","catalogSkills","skills","withStatusMessage","snapshot","toAiFacingPluginStatusSnapshot","_installableCatalog","safeSnapshot","toPluginStatusMetadata","pluginStatus","authStatus","authEmail","authUserId","authRole","repositoryUrl","workspaceSlug","workspaceSlugSource","toFetchFailureOutput","output","metadata"],"sources":["../../src/server/status.ts"],"sourcesContent":["import { AVAILABLE_PUBLISHED_SKILL_TOOLS, resolveAvailableTools } from '../plugin-tools.js';\nimport { buildPublishedSkillsSystemNote } from '../published-skills-system-note.js';\nimport {\n toPublishedSkillCatalog as buildPublishedSkillCatalog,\n toInstallableSkillSummary,\n toPublishedSkillSummary,\n type PublishedSkillDetail,\n type PublishedSkillsSuccessState,\n} from '../published-skills-transform.js';\nimport { readGlobalAuthState, resolveStoredAuthState, toStoredUserKey } from './auth-store.js';\nimport { fetchPublishedSkillsCatalog } from './client.js';\nimport { NATIVE_SKILLS_URL_COMPATIBILITY, PLUGIN_ID, ROOT_SKILL_SEED_PATH } from './constants.js';\nimport { resolveConfig } from './config.js';\nimport { getPublishedSkillIgnoreScopeKey, resolveWorkspace, toWorkspaceResolutionMetadata, toWorkspaceResolutionOutput } from './workspace.js';\nimport type {\n AiFacingPluginStatusSnapshot,\n AuthState,\n FilteredPublishedSkillsResult,\n LoginBootstrapSnapshot,\n PluginAuthStateSummary,\n PluginStatusSnapshot,\n PublishedSkillCatalogPayload,\n PublishedSkillsResult,\n ResolvedConfig,\n} from './types.js';\n\nexport const toPublishedSkillCatalog = (payload: PublishedSkillCatalogPayload): PublishedSkillsSuccessState =>\n buildPublishedSkillCatalog(payload, {\n pluginId: PLUGIN_ID,\n rootSkillSeedPath: ROOT_SKILL_SEED_PATH,\n availableTools: AVAILABLE_PUBLISHED_SKILL_TOOLS,\n });\n\nexport const filterIgnoredPublishedSkills = async (\n config: ResolvedConfig,\n result: PublishedSkillsResult,\n): Promise<FilteredPublishedSkillsResult> => {\n const authState = await readGlobalAuthState(config.authStatePath);\n const userKey = toStoredUserKey(authState);\n\n if (!result.fetchResult.ok) {\n return {\n ...result,\n ignoreState: {\n scopeKey: getPublishedSkillIgnoreScopeKey(result.workspaceResolution),\n userKey,\n ignoredSkillSlugs: [],\n installedGlobalSkillSlugs: [],\n installedWorkspaceSkillSlugs: [],\n },\n ignoredSkills: [],\n };\n }\n\n const ignoredSkills = result.fetchResult.payload.userPreferences.ignoredSkills.map(toPublishedSkillSummary);\n const ignoredSkillSlugs = ignoredSkills.map((skill) => skill.skillSlug);\n\n return {\n ...result,\n ignoreState: {\n scopeKey: result.fetchResult.payload.userPreferences.scopeKey,\n userKey: result.fetchResult.payload.userPreferences.userKey || userKey,\n ignoredSkillSlugs,\n installedGlobalSkillSlugs: [],\n installedWorkspaceSkillSlugs: [],\n },\n ignoredSkills,\n };\n};\n\nconst getWorkspaceUnavailableMessage = (payload: PublishedSkillCatalogPayload): string | null => {\n if (payload.workspace) return null;\n return 'Workspace-specific skills are unavailable because the workspace was not found; global skills are still loaded.';\n};\n\nexport const buildSystemNote = (\n result: PublishedSkillsResult,\n _config: ResolvedConfig,\n details: PublishedSkillDetail[],\n): string | null => {\n if (!result.fetchResult.ok) return null;\n\n const catalog = toPublishedSkillCatalog(result.fetchResult.payload);\n return buildPublishedSkillsSystemNote({\n workspace: result.fetchResult.payload.workspace,\n directoryPath: result.directoryPath,\n catalog,\n details,\n });\n};\n\nexport const formatStatusOutput = async (\n worktree: string,\n config: ResolvedConfig,\n publishedSkillsResult: PublishedSkillsResult,\n loginBootstrapSnapshot: LoginBootstrapSnapshot,\n) => {\n const authState = await resolveStoredAuthState(worktree, config);\n const filteredResult = await filterIgnoredPublishedSkills(config, publishedSkillsResult);\n const base = {\n pluginId: PLUGIN_ID,\n runtimeMode: 'tool_fetch_only',\n nativeSkillsUrlCompatibility: NATIVE_SKILLS_URL_COMPATIBILITY,\n backendOrigin: config.backendOrigin,\n graphqlUrl: config.graphqlUrl,\n fallbackWorkspaceSlug: config.fallbackWorkspaceSlug,\n workspaceResolution: toWorkspaceResolutionOutput(publishedSkillsResult.workspaceResolution),\n rootSkillSeedPath: config.rootSkillSeedPath,\n authStatePath: config.authStatePath,\n requestedDirectoryPath: publishedSkillsResult.directoryPath,\n authMode: publishedSkillsResult.fetchResult.authMode,\n authState:\n authState === null\n ? null\n : {\n email: authState.email,\n userId: authState.userId,\n role: authState.role ?? null,\n authenticatedAt: authState.authenticatedAt,\n expiresAt: authState.expiresAt,\n },\n loginBootstrap:\n loginBootstrapSnapshot.status === 'idle'\n ? null\n : {\n status: loginBootstrapSnapshot.status,\n trigger: loginBootstrapSnapshot.trigger,\n startedAt: loginBootstrapSnapshot.startedAt,\n expiresAt: loginBootstrapSnapshot.expiresAt,\n browserUrl: loginBootstrapSnapshot.browserUrl,\n browserOpenError: loginBootstrapSnapshot.browserOpenError,\n email: loginBootstrapSnapshot.email,\n message: loginBootstrapSnapshot.message,\n },\n status: filteredResult.fetchResult.status,\n fetchedAt: filteredResult.fetchResult.fetchedAt,\n source: filteredResult.fetchResult.source,\n availableTools: resolveAvailableTools(authState?.role ?? null),\n ignoredPublishedSkills: {\n scopeKey: filteredResult.ignoreState.scopeKey,\n userKey: filteredResult.ignoreState.userKey,\n count: filteredResult.ignoreState.ignoredSkillSlugs.length,\n },\n };\n\n if (!filteredResult.fetchResult.ok) {\n return JSON.stringify({ ...base, message: filteredResult.fetchResult.message }, null, 2);\n }\n\n return JSON.stringify(\n {\n ...base,\n ...toPublishedSkillCatalog(filteredResult.fetchResult.payload),\n message: getWorkspaceUnavailableMessage(filteredResult.fetchResult.payload),\n },\n null,\n 2,\n );\n};\n\nexport const toPluginAuthStateSummary = (authState: AuthState | null): PluginAuthStateSummary => {\n if (!authState) {\n return {\n status: 'missing',\n email: null,\n userId: null,\n role: null,\n authenticatedAt: null,\n expiresAt: null,\n };\n }\n\n return {\n status: 'authenticated',\n email: authState.email,\n userId: authState.userId,\n role: authState.role ?? null,\n authenticatedAt: authState.authenticatedAt,\n expiresAt: authState.expiresAt,\n };\n};\n\nexport const resolvePluginStatusSnapshot = async ({\n worktree,\n directory,\n signal,\n}: {\n worktree: string;\n directory: string;\n signal: AbortSignal;\n}): Promise<PluginStatusSnapshot> => {\n const config = await resolveConfig(worktree);\n const workspaceResolution = await resolveWorkspace({ config, directory });\n const fetchResult = await fetchPublishedSkillsCatalog(worktree, config, workspaceResolution, signal);\n const filteredResult = await filterIgnoredPublishedSkills(config, {\n directoryPath: workspaceResolution.directoryPath,\n workspaceResolution,\n fetchResult,\n });\n const authState = await resolveStoredAuthState(worktree, config);\n\n return {\n pluginId: PLUGIN_ID,\n runtimeMode: 'tool_fetch_only',\n nativeSkillsUrlCompatibility: NATIVE_SKILLS_URL_COMPATIBILITY,\n backendOrigin: config.backendOrigin,\n graphqlUrl: config.graphqlUrl,\n fallbackWorkspaceSlug: config.fallbackWorkspaceSlug,\n workspaceResolution: toWorkspaceResolutionOutput(workspaceResolution),\n rootSkillSeedPath: config.rootSkillSeedPath,\n authStatePath: config.authStatePath,\n authState: toPluginAuthStateSummary(authState),\n status: filteredResult.fetchResult.status,\n authMode: filteredResult.fetchResult.authMode,\n fetchedAt: filteredResult.fetchResult.fetchedAt,\n source: filteredResult.fetchResult.source,\n availableTools: resolveAvailableTools(authState?.role ?? null),\n message: filteredResult.fetchResult.ok\n ? getWorkspaceUnavailableMessage(filteredResult.fetchResult.payload)\n : filteredResult.fetchResult.message,\n catalog: filteredResult.fetchResult.ok ? toPublishedSkillCatalog(filteredResult.fetchResult.payload) : null,\n installableCatalog: filteredResult.fetchResult.ok\n ? {\n count: filteredResult.fetchResult.payload.catalogSkills.length,\n skills: filteredResult.fetchResult.payload.catalogSkills.map(toInstallableSkillSummary),\n }\n : null,\n ignoredPublishedSkills: {\n scopeKey: filteredResult.ignoreState.scopeKey,\n userKey: filteredResult.ignoreState.userKey,\n count: filteredResult.ignoreState.ignoredSkillSlugs.length,\n skills: filteredResult.ignoredSkills,\n },\n };\n};\n\nexport const withStatusMessage = (snapshot: PluginStatusSnapshot, message: string): PluginStatusSnapshot => ({\n ...snapshot,\n message,\n});\n\nexport const toAiFacingPluginStatusSnapshot = (snapshot: PluginStatusSnapshot): AiFacingPluginStatusSnapshot => {\n const { ignoredPublishedSkills, installableCatalog: _installableCatalog, ...safeSnapshot } = snapshot;\n\n return {\n ...safeSnapshot,\n ignoredPublishedSkills: {\n scopeKey: ignoredPublishedSkills.scopeKey,\n count: ignoredPublishedSkills.count,\n },\n };\n};\n\nexport const toPluginStatusMetadata = (snapshot: PluginStatusSnapshot): Record<string, string> => ({\n backendOrigin: snapshot.backendOrigin,\n graphqlUrl: snapshot.graphqlUrl,\n pluginStatus: snapshot.status,\n authStatus: snapshot.authState.status,\n authEmail: snapshot.authState.email ?? '',\n authUserId: snapshot.authState.userId ?? '',\n authRole: snapshot.authState.role ?? '',\n directoryPath: snapshot.workspaceResolution.directoryPath,\n repositoryUrl: snapshot.workspaceResolution.repositoryUrl ?? '',\n source: snapshot.source,\n workspaceSlug: snapshot.workspaceResolution.workspaceSlug ?? '',\n workspaceSlugSource: snapshot.workspaceResolution.workspaceSlugSource ?? 'placeholder',\n});\n\nexport const toFetchFailureOutput = async ({\n worktree,\n config,\n publishedSkillsResult,\n loginBootstrapSnapshot,\n}: {\n worktree: string;\n config: ResolvedConfig;\n publishedSkillsResult: PublishedSkillsResult;\n loginBootstrapSnapshot: LoginBootstrapSnapshot;\n}) => ({\n output: await formatStatusOutput(worktree, config, publishedSkillsResult, loginBootstrapSnapshot),\n metadata: {\n status: publishedSkillsResult.fetchResult.status,\n ...toWorkspaceResolutionMetadata(publishedSkillsResult.workspaceResolution),\n source: publishedSkillsResult.fetchResult.source,\n },\n});\n"],"mappings":"AAAA,SAASA,+BAA+B,EAAEC,qBAAqB,QAAQ,oBAAoB;AAC3F,SAASC,8BAA8B,QAAQ,oCAAoC;AACnF,SACEC,uBAAuB,IAAIC,0BAA0B,EACrDC,yBAAyB,EACzBC,uBAAuB,QAGlB,kCAAkC;AACzC,SAASC,mBAAmB,EAAEC,sBAAsB,EAAEC,eAAe,QAAQ,iBAAiB;AAC9F,SAASC,2BAA2B,QAAQ,aAAa;AACzD,SAASC,+BAA+B,EAAEC,SAAS,EAAEC,oBAAoB,QAAQ,gBAAgB;AACjG,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,+BAA+B,EAAEC,gBAAgB,EAAEC,6BAA6B,EAAEC,2BAA2B,QAAQ,gBAAgB;AAa9I,OAAO,MAAMf,uBAAuB,GAAIgB,OAAqC,IAC3Ef,0BAA0B,CAACe,OAAO,EAAE;EAClCC,QAAQ,EAAER,SAAS;EACnBS,iBAAiB,EAAER,oBAAoB;EACvCS,cAAc,EAAEtB;AAClB,CAAC,CAAC;AAEJ,OAAO,MAAMuB,4BAA4B,GAAG,MAAAA,CAC1CC,MAAsB,EACtBC,MAA6B,KACc;EAC3C,MAAMC,SAAS,GAAG,MAAMnB,mBAAmB,CAACiB,MAAM,CAACG,aAAa,CAAC;EACjE,MAAMC,OAAO,GAAGnB,eAAe,CAACiB,SAAS,CAAC;EAE1C,IAAI,CAACD,MAAM,CAACI,WAAW,CAACC,EAAE,EAAE;IAC1B,OAAO;MACL,GAAGL,MAAM;MACTM,WAAW,EAAE;QACXC,QAAQ,EAAEjB,+BAA+B,CAACU,MAAM,CAACQ,mBAAmB,CAAC;QACrEL,OAAO;QACPM,iBAAiB,EAAE,E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AC;AAEF,OAAO,MAAMC,oBAAoB,GAAG,MAAAA,CAAO;EACzCpD,QAAQ;EACR1B,MAAM;EACN2B,qBAAqB;EACrBC;AAMF,CAAC,MAAM;EACLmD,MAAM,EAAE,MAAMtD,kBAAkB,CAACC,QAAQ,EAAE1B,MAAM,EAAE2B,qBAAqB,EAAEC,sBAAsB,CAAC;EACjGoD,QAAQ,EAAE;IACRpC,MAAM,EAAEjB,qBAAqB,CAACtB,WAAW,CAACuC,MAAM;IAChD,GAAGnD,6BAA6B,CAACkC,qBAAqB,CAAClB,mBAAmB,CAAC;IAC3E0C,MAAM,EAAExB,qBAAqB,CAACtB,WAAW,CAAC8C;EAC5C;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["resolveAvailableTools","buildPublishedSkillsSystemNote","toPublishedSkillCatalog","buildPublishedSkillCatalog","toInstallableSkillSummary","toPublishedSkillSummary","readGlobalAuthState","resolveStoredAuthState","toStoredUserKey","fetchPublishedSkillsCatalog","NATIVE_SKILLS_URL_COMPATIBILITY","PLUGIN_ID","ROOT_SKILL_SEED_PATH","resolveConfig","getPublishedSkillIgnoreScopeKey","resolveWorkspace","toWorkspaceResolutionMetadata","toWorkspaceResolutionOutput","payload","availableTools","pluginId","rootSkillSeedPath","filterIgnoredPublishedSkills","config","result","authState","authStatePath","userKey","fetchResult","ok","ignoreState","scopeKey","workspaceResolution","ignoredSkillSlugs","installedGlobalSkillSlugs","installedWorkspaceSkillSlugs","ignoredSkills","userPreferences","map","skill","skillSlug","getWorkspaceUnavailableMessage","workspace","buildSystemNote","_config","details","catalog","directoryPath","formatStatusOutput","worktree","publishedSkillsResult","loginBootstrapSnapshot","filteredResult","base","runtimeMode","nativeSkillsUrlCompatibility","backendOrigin","graphqlUrl","fallbackWorkspaceSlug","requestedDirectoryPath","authMode","email","userId","role","authenticatedAt","expiresAt","loginBootstrap","status","trigger","startedAt","browserUrl","browserOpenError","message","fetchedAt","source","ignoredPublishedSkills","count","length","JSON","stringify","toPluginAuthStateSummary","resolvePluginStatusSnapshot","directory","signal","registeredTools","installableCatalog","catalogSkills","skills","withStatusMessage","snapshot","toAiFacingPluginStatusSnapshot","_installableCatalog","safeSnapshot","toPluginStatusMetadata","pluginStatus","authStatus","authEmail","authUserId","authRole","repositoryUrl","workspaceSlug","workspaceSlugSource","toFetchFailureOutput","output","metadata"],"sources":["../../src/server/status.ts"],"sourcesContent":["import { resolveAvailableTools } from '../plugin-tools.js';\nimport { buildPublishedSkillsSystemNote } from '../published-skills-system-note.js';\nimport {\n toPublishedSkillCatalog as buildPublishedSkillCatalog,\n toInstallableSkillSummary,\n toPublishedSkillSummary,\n type PublishedSkillDetail,\n type PublishedSkillsSuccessState,\n} from '../published-skills-transform.js';\nimport { readGlobalAuthState, resolveStoredAuthState, toStoredUserKey } from './auth-store.js';\nimport { fetchPublishedSkillsCatalog } from './client.js';\nimport { NATIVE_SKILLS_URL_COMPATIBILITY, PLUGIN_ID, ROOT_SKILL_SEED_PATH } from './constants.js';\nimport { resolveConfig } from './config.js';\nimport { getPublishedSkillIgnoreScopeKey, resolveWorkspace, toWorkspaceResolutionMetadata, toWorkspaceResolutionOutput } from './workspace.js';\nimport type {\n AiFacingPluginStatusSnapshot,\n AuthState,\n FilteredPublishedSkillsResult,\n LoginBootstrapSnapshot,\n PluginAuthStateSummary,\n PluginStatusSnapshot,\n PublishedSkillCatalogPayload,\n PublishedSkillsResult,\n ResolvedConfig,\n} from './types.js';\n\nexport const toPublishedSkillCatalog = (\n payload: PublishedSkillCatalogPayload,\n availableTools: string[] = resolveAvailableTools(null),\n): PublishedSkillsSuccessState =>\n buildPublishedSkillCatalog(payload, {\n pluginId: PLUGIN_ID,\n rootSkillSeedPath: ROOT_SKILL_SEED_PATH,\n availableTools,\n });\n\nexport const filterIgnoredPublishedSkills = async (\n config: ResolvedConfig,\n result: PublishedSkillsResult,\n): Promise<FilteredPublishedSkillsResult> => {\n const authState = await readGlobalAuthState(config.authStatePath);\n const userKey = toStoredUserKey(authState);\n\n if (!result.fetchResult.ok) {\n return {\n ...result,\n ignoreState: {\n scopeKey: getPublishedSkillIgnoreScopeKey(result.workspaceResolution),\n userKey,\n ignoredSkillSlugs: [],\n installedGlobalSkillSlugs: [],\n installedWorkspaceSkillSlugs: [],\n },\n ignoredSkills: [],\n };\n }\n\n const ignoredSkills = result.fetchResult.payload.userPreferences.ignoredSkills.map(toPublishedSkillSummary);\n const ignoredSkillSlugs = ignoredSkills.map((skill) => skill.skillSlug);\n\n return {\n ...result,\n ignoreState: {\n scopeKey: result.fetchResult.payload.userPreferences.scopeKey,\n userKey: result.fetchResult.payload.userPreferences.userKey || userKey,\n ignoredSkillSlugs,\n installedGlobalSkillSlugs: [],\n installedWorkspaceSkillSlugs: [],\n },\n ignoredSkills,\n };\n};\n\nconst getWorkspaceUnavailableMessage = (payload: PublishedSkillCatalogPayload): string | null => {\n if (payload.workspace) return null;\n return 'Workspace-specific skills are unavailable because the workspace was not found; global skills are still loaded.';\n};\n\nexport const buildSystemNote = (\n result: PublishedSkillsResult,\n _config: ResolvedConfig,\n details: PublishedSkillDetail[],\n): string | null => {\n if (!result.fetchResult.ok) return null;\n\n const catalog = toPublishedSkillCatalog(result.fetchResult.payload);\n return buildPublishedSkillsSystemNote({\n workspace: result.fetchResult.payload.workspace,\n directoryPath: result.directoryPath,\n catalog,\n details,\n });\n};\n\nexport const formatStatusOutput = async (\n worktree: string,\n config: ResolvedConfig,\n publishedSkillsResult: PublishedSkillsResult,\n loginBootstrapSnapshot: LoginBootstrapSnapshot,\n) => {\n const authState = await resolveStoredAuthState(worktree, config);\n const filteredResult = await filterIgnoredPublishedSkills(config, publishedSkillsResult);\n const base = {\n pluginId: PLUGIN_ID,\n runtimeMode: 'tool_fetch_only',\n nativeSkillsUrlCompatibility: NATIVE_SKILLS_URL_COMPATIBILITY,\n backendOrigin: config.backendOrigin,\n graphqlUrl: config.graphqlUrl,\n fallbackWorkspaceSlug: config.fallbackWorkspaceSlug,\n workspaceResolution: toWorkspaceResolutionOutput(publishedSkillsResult.workspaceResolution),\n rootSkillSeedPath: config.rootSkillSeedPath,\n authStatePath: config.authStatePath,\n requestedDirectoryPath: publishedSkillsResult.directoryPath,\n authMode: publishedSkillsResult.fetchResult.authMode,\n authState:\n authState === null\n ? null\n : {\n email: authState.email,\n userId: authState.userId,\n role: authState.role ?? null,\n authenticatedAt: authState.authenticatedAt,\n expiresAt: authState.expiresAt,\n },\n loginBootstrap:\n loginBootstrapSnapshot.status === 'idle'\n ? null\n : {\n status: loginBootstrapSnapshot.status,\n trigger: loginBootstrapSnapshot.trigger,\n startedAt: loginBootstrapSnapshot.startedAt,\n expiresAt: loginBootstrapSnapshot.expiresAt,\n browserUrl: loginBootstrapSnapshot.browserUrl,\n browserOpenError: loginBootstrapSnapshot.browserOpenError,\n email: loginBootstrapSnapshot.email,\n message: loginBootstrapSnapshot.message,\n },\n status: filteredResult.fetchResult.status,\n fetchedAt: filteredResult.fetchResult.fetchedAt,\n source: filteredResult.fetchResult.source,\n availableTools: resolveAvailableTools(authState?.role ?? null),\n ignoredPublishedSkills: {\n scopeKey: filteredResult.ignoreState.scopeKey,\n userKey: filteredResult.ignoreState.userKey,\n count: filteredResult.ignoreState.ignoredSkillSlugs.length,\n },\n };\n\n if (!filteredResult.fetchResult.ok) {\n return JSON.stringify({ ...base, message: filteredResult.fetchResult.message }, null, 2);\n }\n\n return JSON.stringify(\n {\n ...base,\n ...toPublishedSkillCatalog(filteredResult.fetchResult.payload, base.availableTools),\n message: getWorkspaceUnavailableMessage(filteredResult.fetchResult.payload),\n },\n null,\n 2,\n );\n};\n\nexport const toPluginAuthStateSummary = (authState: AuthState | null): PluginAuthStateSummary => {\n if (!authState) {\n return {\n status: 'missing',\n email: null,\n userId: null,\n role: null,\n authenticatedAt: null,\n expiresAt: null,\n };\n }\n\n return {\n status: 'authenticated',\n email: authState.email,\n userId: authState.userId,\n role: authState.role ?? null,\n authenticatedAt: authState.authenticatedAt,\n expiresAt: authState.expiresAt,\n };\n};\n\nexport const resolvePluginStatusSnapshot = async ({\n worktree,\n directory,\n signal,\n registeredTools,\n}: {\n worktree: string;\n directory: string;\n signal: AbortSignal;\n registeredTools?: string[];\n}): Promise<PluginStatusSnapshot> => {\n const config = await resolveConfig(worktree);\n const workspaceResolution = await resolveWorkspace({ config, directory });\n const fetchResult = await fetchPublishedSkillsCatalog(worktree, config, workspaceResolution, signal);\n const filteredResult = await filterIgnoredPublishedSkills(config, {\n directoryPath: workspaceResolution.directoryPath,\n workspaceResolution,\n fetchResult,\n });\n const authState = await resolveStoredAuthState(worktree, config);\n const availableTools = registeredTools ?? resolveAvailableTools(authState?.role ?? null);\n\n return {\n pluginId: PLUGIN_ID,\n runtimeMode: 'tool_fetch_only',\n nativeSkillsUrlCompatibility: NATIVE_SKILLS_URL_COMPATIBILITY,\n backendOrigin: config.backendOrigin,\n graphqlUrl: config.graphqlUrl,\n fallbackWorkspaceSlug: config.fallbackWorkspaceSlug,\n workspaceResolution: toWorkspaceResolutionOutput(workspaceResolution),\n rootSkillSeedPath: config.rootSkillSeedPath,\n authStatePath: config.authStatePath,\n authState: toPluginAuthStateSummary(authState),\n status: filteredResult.fetchResult.status,\n authMode: filteredResult.fetchResult.authMode,\n fetchedAt: filteredResult.fetchResult.fetchedAt,\n source: filteredResult.fetchResult.source,\n availableTools,\n message: filteredResult.fetchResult.ok\n ? getWorkspaceUnavailableMessage(filteredResult.fetchResult.payload)\n : filteredResult.fetchResult.message,\n catalog: filteredResult.fetchResult.ok ? toPublishedSkillCatalog(filteredResult.fetchResult.payload, availableTools) : null,\n installableCatalog: filteredResult.fetchResult.ok\n ? {\n count: filteredResult.fetchResult.payload.catalogSkills.length,\n skills: filteredResult.fetchResult.payload.catalogSkills.map(toInstallableSkillSummary),\n }\n : null,\n ignoredPublishedSkills: {\n scopeKey: filteredResult.ignoreState.scopeKey,\n userKey: filteredResult.ignoreState.userKey,\n count: filteredResult.ignoreState.ignoredSkillSlugs.length,\n skills: filteredResult.ignoredSkills,\n },\n };\n};\n\nexport const withStatusMessage = (snapshot: PluginStatusSnapshot, message: string): PluginStatusSnapshot => ({\n ...snapshot,\n message,\n});\n\nexport const toAiFacingPluginStatusSnapshot = (snapshot: PluginStatusSnapshot): AiFacingPluginStatusSnapshot => {\n const { ignoredPublishedSkills, installableCatalog: _installableCatalog, ...safeSnapshot } = snapshot;\n\n return {\n ...safeSnapshot,\n ignoredPublishedSkills: {\n scopeKey: ignoredPublishedSkills.scopeKey,\n count: ignoredPublishedSkills.count,\n },\n };\n};\n\nexport const toPluginStatusMetadata = (snapshot: PluginStatusSnapshot): Record<string, string> => ({\n backendOrigin: snapshot.backendOrigin,\n graphqlUrl: snapshot.graphqlUrl,\n pluginStatus: snapshot.status,\n authStatus: snapshot.authState.status,\n authEmail: snapshot.authState.email ?? '',\n authUserId: snapshot.authState.userId ?? '',\n authRole: snapshot.authState.role ?? '',\n directoryPath: snapshot.workspaceResolution.directoryPath,\n repositoryUrl: snapshot.workspaceResolution.repositoryUrl ?? '',\n source: snapshot.source,\n workspaceSlug: snapshot.workspaceResolution.workspaceSlug ?? '',\n workspaceSlugSource: snapshot.workspaceResolution.workspaceSlugSource ?? 'placeholder',\n});\n\nexport const toFetchFailureOutput = async ({\n worktree,\n config,\n publishedSkillsResult,\n loginBootstrapSnapshot,\n}: {\n worktree: string;\n config: ResolvedConfig;\n publishedSkillsResult: PublishedSkillsResult;\n loginBootstrapSnapshot: LoginBootstrapSnapshot;\n}) => ({\n output: await formatStatusOutput(worktree, config, publishedSkillsResult, loginBootstrapSnapshot),\n metadata: {\n status: publishedSkillsResult.fetchResult.status,\n ...toWorkspaceResolutionMetadata(publishedSkillsResult.workspaceResolution),\n source: publishedSkillsResult.fetchResult.source,\n },\n});\n"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,8BAA8B,QAAQ,oCAAoC;AACnF,SACEC,uBAAuB,IAAIC,0BAA0B,EACrDC,yBAAyB,EACzBC,uBAAuB,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,QAAQ,EAAE;IACRrC,MAAM,EAAEjB,qBAAqB,CAACtB,WAAW,CAACuC,MAAM;IAChD,GAAGnD,6BAA6B,CAACkC,qBAAqB,CAAClB,mBAAmB,CAAC;IAC3E0C,MAAM,EAAExB,qBAAqB,CAACtB,WAAW,CAAC8C;EAC5C;AACF,CAAC,CAAC","ignoreList":[]}
@@ -86,13 +86,15 @@ export type PublishedSkillUserPreferences = {
86
86
  };
87
87
  export type PublishedSkillPreferenceScope = 'GLOBAL' | 'WORKSPACE';
88
88
  export type CreateOrUpdateSkillFromMarkdownResponse = {
89
- createOrUpdateSkillFromMarkdown: {
90
- success: boolean;
91
- skillSlug: string;
92
- skillVersionId: string | null;
93
- artifactSlug: string | null;
94
- artifactVersionId: string | null;
95
- errors: string[];
89
+ admin: {
90
+ createOrUpdateSkillFromMarkdown: {
91
+ success: boolean;
92
+ skillSlug: string | null;
93
+ skillVersionId: string | null;
94
+ artifactSlug: string | null;
95
+ artifactVersionId: string | null;
96
+ errors: string[];
97
+ };
96
98
  };
97
99
  };
98
100
  export type ImportWizardArtifactSnapshotResponse = {
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/server/types.ts"],"sourcesContent":["import type { ToolFactory } from '../plugin-tools.js';\nimport type { PublishedSkillDetail, PublishedSkillSummary, PublishedSkillsSuccessState } from '../published-skills-transform.js';\nimport type { NativeSkillsUrlCompatibility } from './constants.js';\n\nexport type ResolvedConfig = {\n backendOrigin: string;\n graphqlUrl: string;\n authSessionUrl: string;\n presenceUrl: string;\n actionsUrl: string;\n configuredWorkspaceSlug: string | null;\n fallbackWorkspaceSlug: string;\n rootSkillSeedPath: string;\n authStatePath: string;\n};\n\nexport type WorkspaceResolution = {\n requestedDirectory: string;\n repositoryRoot: string;\n repositoryUrl: string | null;\n workspaceSlug?: string | null;\n workspaceSlugSource?: 'configured' | 'learned' | 'backend' | 'fallback' | 'repositoryUrl' | 'placeholder';\n fallbackWorkspaceSlug: string | null;\n directoryPath: string;\n cacheKey: string;\n};\n\nexport type WorkspaceResolutionOutput = {\n requestedDirectory: string;\n repositoryRoot: string;\n repositoryUrl: string | null;\n workspaceSlug?: string | null;\n workspaceSlugSource?: WorkspaceResolution['workspaceSlugSource'];\n fallbackWorkspaceSlug: string | null;\n directoryPath: string;\n};\n\nexport type StoredWorkspaceSlugMapping = {\n repositoryUrl: string | null;\n repositoryRoot: string | null;\n workspaceSlug: string;\n updatedAt: string;\n};\n\nexport type PublishedSkillCatalogResponse = {\n pluginPublishedSkills: PublishedSkillCatalogPayload;\n};\n\nexport type PublishedSkillDetailResponse = {\n pluginPublishedSkillVersionArtifact: PublishedSkillArtifactDetailPayload | null;\n};\n\nexport type WizardArtifactKind = 'SKILL' | 'DESIGN_DOC';\n\nexport type WizardArtifactCatalogResponse = {\n pluginWizardArtifacts: WizardArtifactCatalogPayload;\n};\n\nexport type WizardArtifactDetailResponse = {\n pluginWizardArtifactVersion: WizardArtifactDetailPayload | null;\n};\n\nexport type PublishedSkillCatalogPayload = {\n workspace: {\n id: string;\n slug: string;\n name: string;\n repositoryUrl?: string | null;\n defaultBranch?: string | null;\n status: string;\n } | null;\n directoryPath: string;\n skills: PublishedSkillCatalogItem[];\n catalogSkills: PublishedSkillInstallableCatalogItem[];\n userPreferences: PublishedSkillUserPreferences;\n};\n\nexport type WizardArtifactCatalogPayload = {\n artifactKind: WizardArtifactKind;\n workspace: PublishedSkillCatalogPayload['workspace'];\n directoryPath: string;\n artifacts: WizardArtifactCatalogItem[];\n catalogArtifacts: WizardArtifactInstallableCatalogItem[];\n artifactPreferences: WizardArtifactUserPreferences;\n unsupportedReason?: string | null;\n message?: string | null;\n};\n\nexport type WizardArtifactUserPreferences = {\n scopeKey: string;\n userKey: string;\n ignoredArtifacts: WizardArtifactCatalogItem[];\n};\n\nexport type PublishedSkillUserPreferences = {\n scopeKey: string;\n userKey: string;\n ignoredSkills: PublishedSkillCatalogItem[];\n};\n\nexport type PublishedSkillPreferenceScope = 'GLOBAL' | 'WORKSPACE';\n\nexport type CreateOrUpdateSkillFromMarkdownResponse = {\n createOrUpdateSkillFromMarkdown: {\n success: boolean;\n skillSlug: string;\n skillVersionId: string | null;\n artifactSlug: string | null;\n artifactVersionId: string | null;\n errors: string[];\n };\n};\n\nexport type ImportWizardArtifactSnapshotResponse = {\n importWizardArtifactSnapshot: {\n success: boolean;\n skillSlug: string | null;\n skillVersionId: string | null;\n artifactSlug: string | null;\n artifactVersionId: string | null;\n errors: string[];\n };\n};\n\nexport type SetPublishedSkillPreferenceResponse = {\n setPublishedSkillPreference: PublishedSkillUserPreferences;\n};\n\nexport type PublishedSkillInstallableCatalogItem = Pick<\n PublishedSkillCatalogItem,\n 'skill' | 'skillVersion' | 'publishedArtifact'\n>;\n\nexport type PublishedSkillCatalogItem = {\n assignmentSource: string;\n assignmentType: string;\n scopePath: string;\n includeChildren?: boolean | null;\n skill: {\n id: string;\n slug: string;\n name: string;\n summary?: string | null;\n whenToUse?: string | null;\n status: string;\n installPolicy: PublishedSkillInstallPolicy;\n tags: PublishedSkillTag[];\n };\n skillVersion: {\n id: string;\n version: string;\n title?: string | null;\n summary?: string | null;\n status: string;\n };\n publishedArtifact: {\n id: string;\n frontmatterName: string;\n frontmatterDescription: string;\n checksum: string;\n revision?: string | null;\n updatedAtCursor?: string | null;\n publishedAt?: string | null;\n fileCount: number;\n };\n};\n\nexport type WizardArtifactInstallableCatalogItem = Pick<\n WizardArtifactCatalogItem,\n 'artifact' | 'artifactVersion'\n>;\n\nexport type WizardArtifactCatalogItem = {\n assignmentSource: string;\n assignmentType: string;\n scopePath: string;\n includeChildren?: boolean | null;\n artifact: {\n id: string;\n kind: WizardArtifactKind;\n slug: string;\n name: string;\n summary?: string | null;\n whenToUse?: string | null;\n status: string;\n installPolicy: PublishedSkillInstallPolicy;\n };\n artifactVersion: {\n id: string;\n version: string;\n title?: string | null;\n summary?: string | null;\n status: string;\n frontmatterName: string;\n frontmatterDescription: string;\n checksum: string;\n revision?: string | null;\n updatedAtCursor?: string | null;\n canonicalFilePath: string;\n publishedAt?: string | null;\n fileCount: number;\n };\n};\n\nexport type PublishedSkillArtifactFilePayload = {\n id: string;\n relativePath: string;\n contentType: string;\n content: string;\n checksum: string;\n size: number;\n sortOrder: number;\n};\n\nexport type PublishedSkillFacet = {\n id: string;\n slug: string;\n label: string;\n description?: string | null;\n};\n\nexport type PublishedSkillTag = {\n id: string;\n slug: string;\n label: string;\n description?: string | null;\n facet?: PublishedSkillFacet | null;\n};\n\nexport type PublishedSkillInstallPolicy = 'GLOBAL_CONTEXT' | 'PROJECT_INSTALLABLE';\n\nexport type PublishedSkillDetailItem = PublishedSkillCatalogItem & {\n publishedArtifact: PublishedSkillCatalogItem['publishedArtifact'] & {\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n };\n};\n\nexport type WizardArtifactDetailItem = WizardArtifactCatalogItem & {\n artifactVersion: WizardArtifactCatalogItem['artifactVersion'] & {\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n };\n};\n\nexport type PublishedSkillArtifactDetailPayload = PublishedSkillCatalogItem['publishedArtifact'] & {\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n};\n\nexport type WizardArtifactDetailPayload = WizardArtifactCatalogItem['artifactVersion'] & {\n artifact: WizardArtifactCatalogItem['artifact'];\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n};\n\nexport type PublishedSkillArtifactDetailPurpose = 'TOOL_FETCH';\n\nexport type GraphQLErrorItem = {\n message: string;\n};\n\nexport type GraphQLResponse<TData> = {\n data?: TData;\n errors?: GraphQLErrorItem[];\n};\n\nexport type AuthState = {\n pluginId: string;\n sessionToken: string;\n expiresAt: string;\n authenticatedAt: string;\n userId: string;\n email: string;\n role?: 'ADMIN' | 'EDITOR' | null;\n};\n\nexport type PresenceEventType = 'START' | 'STOP';\n\nexport type PluginActionEventType =\n | PresenceEventType\n | 'FETCH_SUCCESS'\n | 'FETCH_FAILED'\n | 'LOGIN_SUCCESS'\n | 'LOGIN_FAILED'\n | 'PREFERENCE_SUCCESS'\n | 'PREFERENCE_FAILED';\n\nexport type LoginBootstrapTrigger = 'fetch' | 'status';\n\nexport type LoginBootstrapSnapshot = {\n status: 'idle' | 'starting' | 'pending' | 'authenticated' | 'failed';\n trigger: LoginBootstrapTrigger | null;\n startedAt: string | null;\n expiresAt: string | null;\n browserUrl: string | null;\n browserOpenError: string | null;\n email: string | null;\n message: string | null;\n};\n\nexport type StatusPathLoginBootstrap = {\n promise: Promise<AuthState> | null;\n status: 'idle' | 'pending' | 'authenticated' | 'failed';\n message: string | null;\n failedAt: number | null;\n};\n\nexport type FetchResult =\n | {\n ok: true;\n status: 'ready';\n authMode: 'session';\n payload: PublishedSkillCatalogPayload;\n fetchedAt: string;\n source: 'network' | 'cache';\n }\n | {\n ok: false;\n status: 'missing_auth' | 'request_failed';\n authMode: 'missing' | 'session';\n message: string;\n fetchedAt: string;\n source: 'network' | 'cache';\n };\n\nexport type CacheEntry = {\n result: FetchResult;\n expiresAt: number;\n cursor: string;\n};\n\nexport type WizardArtifactFetchResult =\n | {\n ok: true;\n status: 'ready';\n authMode: 'session';\n payload: WizardArtifactCatalogPayload;\n fetchedAt: string;\n source: 'network' | 'cache';\n }\n | Extract<FetchResult, { ok: false }>;\n\nexport type DetailCacheEntry = {\n artifact: PublishedSkillArtifactDetailPayload;\n expiresAt: number;\n revision: string;\n};\n\nexport type WizardArtifactDetailCacheEntry = {\n artifact: WizardArtifactDetailPayload;\n expiresAt: number;\n revision: string;\n};\n\nexport type PublishedSkillPreferenceAction = 'install' | 'uninstall' | 'ignore' | 'unignore';\n\nexport type OpencodePluginModule = {\n tool: ToolFactory;\n};\n\nexport type OpencodePluginServerInput = {\n worktree: string;\n directory: string;\n};\n\nexport type OpencodePluginSystemTransformOutput = {\n system: string[];\n};\n\nexport type OpencodePluginServer = (input: OpencodePluginServerInput) => Promise<{\n tool: Record<string, unknown>;\n 'experimental.chat.system.transform': (\n hookInput: unknown,\n output: OpencodePluginSystemTransformOutput,\n ) => Promise<void>;\n}>;\n\nexport type PublishedSkillsResult = {\n directoryPath: string;\n workspaceResolution: WorkspaceResolution;\n fetchResult: FetchResult;\n};\n\nexport type PublishedSkillsIgnoreState = {\n scopeKey: string;\n userKey: string;\n ignoredSkillSlugs: string[];\n installedGlobalSkillSlugs: string[];\n installedWorkspaceSkillSlugs: string[];\n};\n\nexport type PublishedSkillPreferenceCacheContext = {\n userKey: string;\n preferenceVersion: number;\n};\n\nexport type FilteredPublishedSkillsResult = PublishedSkillsResult & {\n ignoreState: PublishedSkillsIgnoreState;\n ignoredSkills: PublishedSkillSummary[];\n};\n\nexport type PublishedSkillDetailResult =\n | {\n ok: true;\n detail: PublishedSkillDetail;\n }\n | {\n ok: false;\n status: 'not_found' | 'missing_auth' | 'request_failed';\n output: string;\n metadata: Record<string, string>;\n };\n\nexport type PluginAuthStateSummary = {\n status: 'missing' | 'authenticated';\n email: string | null;\n userId: string | null;\n role: 'ADMIN' | 'EDITOR' | null;\n authenticatedAt: string | null;\n expiresAt: string | null;\n};\n\nexport type PluginStatusSnapshot = {\n pluginId: string;\n runtimeMode: 'tool_fetch_only';\n nativeSkillsUrlCompatibility: NativeSkillsUrlCompatibility;\n backendOrigin: string;\n graphqlUrl: string;\n fallbackWorkspaceSlug: string;\n workspaceResolution: WorkspaceResolutionOutput;\n rootSkillSeedPath: string;\n authStatePath: string;\n authState: PluginAuthStateSummary;\n status: FetchResult['status'];\n authMode: FetchResult['authMode'];\n fetchedAt: string;\n source: FetchResult['source'];\n availableTools: string[];\n message: string | null;\n catalog: PublishedSkillsSuccessState | null;\n installableCatalog: {\n count: number;\n skills: PublishedSkillSummary[];\n } | null;\n ignoredPublishedSkills: {\n scopeKey: string;\n userKey: string;\n count: number;\n skills: PublishedSkillSummary[];\n };\n};\n\nexport type AiFacingIgnoredPublishedSkillsSummary = {\n scopeKey: string;\n count: number;\n};\n\nexport type AiFacingPluginStatusSnapshot = Omit<PluginStatusSnapshot, 'ignoredPublishedSkills' | 'installableCatalog'> & {\n ignoredPublishedSkills: AiFacingIgnoredPublishedSkillsSummary;\n};\n\nexport type OidcDiscoveryDocument = {\n authorization_endpoint: string;\n};\n\nexport type PluginSessionResponse = {\n success: true;\n session: {\n jwtToken: string;\n expiresAt: string;\n user: {\n id: string;\n email: string;\n role?: 'ADMIN' | 'EDITOR';\n };\n };\n};\n\nexport type OidcCallbackPayload =\n | {\n status: 'success';\n code: string;\n state: string;\n }\n | {\n status: 'error';\n message: string;\n };\n\nexport type OidcLoginStart = {\n browserUrl: string;\n expiresAt: string;\n codeVerifier: string;\n expectedState: string;\n callbackPromise: Promise<OidcCallbackPayload>;\n closeCallbackServer: () => Promise<void>;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../src/server/types.ts"],"sourcesContent":["import type { ToolFactory } from '../plugin-tools.js';\nimport type { PublishedSkillDetail, PublishedSkillSummary, PublishedSkillsSuccessState } from '../published-skills-transform.js';\nimport type { NativeSkillsUrlCompatibility } from './constants.js';\n\nexport type ResolvedConfig = {\n backendOrigin: string;\n graphqlUrl: string;\n authSessionUrl: string;\n presenceUrl: string;\n actionsUrl: string;\n configuredWorkspaceSlug: string | null;\n fallbackWorkspaceSlug: string;\n rootSkillSeedPath: string;\n authStatePath: string;\n};\n\nexport type WorkspaceResolution = {\n requestedDirectory: string;\n repositoryRoot: string;\n repositoryUrl: string | null;\n workspaceSlug?: string | null;\n workspaceSlugSource?: 'configured' | 'learned' | 'backend' | 'fallback' | 'repositoryUrl' | 'placeholder';\n fallbackWorkspaceSlug: string | null;\n directoryPath: string;\n cacheKey: string;\n};\n\nexport type WorkspaceResolutionOutput = {\n requestedDirectory: string;\n repositoryRoot: string;\n repositoryUrl: string | null;\n workspaceSlug?: string | null;\n workspaceSlugSource?: WorkspaceResolution['workspaceSlugSource'];\n fallbackWorkspaceSlug: string | null;\n directoryPath: string;\n};\n\nexport type StoredWorkspaceSlugMapping = {\n repositoryUrl: string | null;\n repositoryRoot: string | null;\n workspaceSlug: string;\n updatedAt: string;\n};\n\nexport type PublishedSkillCatalogResponse = {\n pluginPublishedSkills: PublishedSkillCatalogPayload;\n};\n\nexport type PublishedSkillDetailResponse = {\n pluginPublishedSkillVersionArtifact: PublishedSkillArtifactDetailPayload | null;\n};\n\nexport type WizardArtifactKind = 'SKILL' | 'DESIGN_DOC';\n\nexport type WizardArtifactCatalogResponse = {\n pluginWizardArtifacts: WizardArtifactCatalogPayload;\n};\n\nexport type WizardArtifactDetailResponse = {\n pluginWizardArtifactVersion: WizardArtifactDetailPayload | null;\n};\n\nexport type PublishedSkillCatalogPayload = {\n workspace: {\n id: string;\n slug: string;\n name: string;\n repositoryUrl?: string | null;\n defaultBranch?: string | null;\n status: string;\n } | null;\n directoryPath: string;\n skills: PublishedSkillCatalogItem[];\n catalogSkills: PublishedSkillInstallableCatalogItem[];\n userPreferences: PublishedSkillUserPreferences;\n};\n\nexport type WizardArtifactCatalogPayload = {\n artifactKind: WizardArtifactKind;\n workspace: PublishedSkillCatalogPayload['workspace'];\n directoryPath: string;\n artifacts: WizardArtifactCatalogItem[];\n catalogArtifacts: WizardArtifactInstallableCatalogItem[];\n artifactPreferences: WizardArtifactUserPreferences;\n unsupportedReason?: string | null;\n message?: string | null;\n};\n\nexport type WizardArtifactUserPreferences = {\n scopeKey: string;\n userKey: string;\n ignoredArtifacts: WizardArtifactCatalogItem[];\n};\n\nexport type PublishedSkillUserPreferences = {\n scopeKey: string;\n userKey: string;\n ignoredSkills: PublishedSkillCatalogItem[];\n};\n\nexport type PublishedSkillPreferenceScope = 'GLOBAL' | 'WORKSPACE';\n\nexport type CreateOrUpdateSkillFromMarkdownResponse = {\n admin: {\n createOrUpdateSkillFromMarkdown: {\n success: boolean;\n skillSlug: string | null;\n skillVersionId: string | null;\n artifactSlug: string | null;\n artifactVersionId: string | null;\n errors: string[];\n };\n };\n};\n\nexport type ImportWizardArtifactSnapshotResponse = {\n importWizardArtifactSnapshot: {\n success: boolean;\n skillSlug: string | null;\n skillVersionId: string | null;\n artifactSlug: string | null;\n artifactVersionId: string | null;\n errors: string[];\n };\n};\n\nexport type SetPublishedSkillPreferenceResponse = {\n setPublishedSkillPreference: PublishedSkillUserPreferences;\n};\n\nexport type PublishedSkillInstallableCatalogItem = Pick<\n PublishedSkillCatalogItem,\n 'skill' | 'skillVersion' | 'publishedArtifact'\n>;\n\nexport type PublishedSkillCatalogItem = {\n assignmentSource: string;\n assignmentType: string;\n scopePath: string;\n includeChildren?: boolean | null;\n skill: {\n id: string;\n slug: string;\n name: string;\n summary?: string | null;\n whenToUse?: string | null;\n status: string;\n installPolicy: PublishedSkillInstallPolicy;\n tags: PublishedSkillTag[];\n };\n skillVersion: {\n id: string;\n version: string;\n title?: string | null;\n summary?: string | null;\n status: string;\n };\n publishedArtifact: {\n id: string;\n frontmatterName: string;\n frontmatterDescription: string;\n checksum: string;\n revision?: string | null;\n updatedAtCursor?: string | null;\n publishedAt?: string | null;\n fileCount: number;\n };\n};\n\nexport type WizardArtifactInstallableCatalogItem = Pick<\n WizardArtifactCatalogItem,\n 'artifact' | 'artifactVersion'\n>;\n\nexport type WizardArtifactCatalogItem = {\n assignmentSource: string;\n assignmentType: string;\n scopePath: string;\n includeChildren?: boolean | null;\n artifact: {\n id: string;\n kind: WizardArtifactKind;\n slug: string;\n name: string;\n summary?: string | null;\n whenToUse?: string | null;\n status: string;\n installPolicy: PublishedSkillInstallPolicy;\n };\n artifactVersion: {\n id: string;\n version: string;\n title?: string | null;\n summary?: string | null;\n status: string;\n frontmatterName: string;\n frontmatterDescription: string;\n checksum: string;\n revision?: string | null;\n updatedAtCursor?: string | null;\n canonicalFilePath: string;\n publishedAt?: string | null;\n fileCount: number;\n };\n};\n\nexport type PublishedSkillArtifactFilePayload = {\n id: string;\n relativePath: string;\n contentType: string;\n content: string;\n checksum: string;\n size: number;\n sortOrder: number;\n};\n\nexport type PublishedSkillFacet = {\n id: string;\n slug: string;\n label: string;\n description?: string | null;\n};\n\nexport type PublishedSkillTag = {\n id: string;\n slug: string;\n label: string;\n description?: string | null;\n facet?: PublishedSkillFacet | null;\n};\n\nexport type PublishedSkillInstallPolicy = 'GLOBAL_CONTEXT' | 'PROJECT_INSTALLABLE';\n\nexport type PublishedSkillDetailItem = PublishedSkillCatalogItem & {\n publishedArtifact: PublishedSkillCatalogItem['publishedArtifact'] & {\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n };\n};\n\nexport type WizardArtifactDetailItem = WizardArtifactCatalogItem & {\n artifactVersion: WizardArtifactCatalogItem['artifactVersion'] & {\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n };\n};\n\nexport type PublishedSkillArtifactDetailPayload = PublishedSkillCatalogItem['publishedArtifact'] & {\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n};\n\nexport type WizardArtifactDetailPayload = WizardArtifactCatalogItem['artifactVersion'] & {\n artifact: WizardArtifactCatalogItem['artifact'];\n markdownBody: string;\n renderedContent: string;\n files: PublishedSkillArtifactFilePayload[];\n};\n\nexport type PublishedSkillArtifactDetailPurpose = 'TOOL_FETCH';\n\nexport type GraphQLErrorItem = {\n message: string;\n};\n\nexport type GraphQLResponse<TData> = {\n data?: TData;\n errors?: GraphQLErrorItem[];\n};\n\nexport type AuthState = {\n pluginId: string;\n sessionToken: string;\n expiresAt: string;\n authenticatedAt: string;\n userId: string;\n email: string;\n role?: 'ADMIN' | 'EDITOR' | null;\n};\n\nexport type PresenceEventType = 'START' | 'STOP';\n\nexport type PluginActionEventType =\n | PresenceEventType\n | 'FETCH_SUCCESS'\n | 'FETCH_FAILED'\n | 'LOGIN_SUCCESS'\n | 'LOGIN_FAILED'\n | 'PREFERENCE_SUCCESS'\n | 'PREFERENCE_FAILED';\n\nexport type LoginBootstrapTrigger = 'fetch' | 'status';\n\nexport type LoginBootstrapSnapshot = {\n status: 'idle' | 'starting' | 'pending' | 'authenticated' | 'failed';\n trigger: LoginBootstrapTrigger | null;\n startedAt: string | null;\n expiresAt: string | null;\n browserUrl: string | null;\n browserOpenError: string | null;\n email: string | null;\n message: string | null;\n};\n\nexport type StatusPathLoginBootstrap = {\n promise: Promise<AuthState> | null;\n status: 'idle' | 'pending' | 'authenticated' | 'failed';\n message: string | null;\n failedAt: number | null;\n};\n\nexport type FetchResult =\n | {\n ok: true;\n status: 'ready';\n authMode: 'session';\n payload: PublishedSkillCatalogPayload;\n fetchedAt: string;\n source: 'network' | 'cache';\n }\n | {\n ok: false;\n status: 'missing_auth' | 'request_failed';\n authMode: 'missing' | 'session';\n message: string;\n fetchedAt: string;\n source: 'network' | 'cache';\n };\n\nexport type CacheEntry = {\n result: FetchResult;\n expiresAt: number;\n cursor: string;\n};\n\nexport type WizardArtifactFetchResult =\n | {\n ok: true;\n status: 'ready';\n authMode: 'session';\n payload: WizardArtifactCatalogPayload;\n fetchedAt: string;\n source: 'network' | 'cache';\n }\n | Extract<FetchResult, { ok: false }>;\n\nexport type DetailCacheEntry = {\n artifact: PublishedSkillArtifactDetailPayload;\n expiresAt: number;\n revision: string;\n};\n\nexport type WizardArtifactDetailCacheEntry = {\n artifact: WizardArtifactDetailPayload;\n expiresAt: number;\n revision: string;\n};\n\nexport type PublishedSkillPreferenceAction = 'install' | 'uninstall' | 'ignore' | 'unignore';\n\nexport type OpencodePluginModule = {\n tool: ToolFactory;\n};\n\nexport type OpencodePluginServerInput = {\n worktree: string;\n directory: string;\n};\n\nexport type OpencodePluginSystemTransformOutput = {\n system: string[];\n};\n\nexport type OpencodePluginServer = (input: OpencodePluginServerInput) => Promise<{\n tool: Record<string, unknown>;\n 'experimental.chat.system.transform': (\n hookInput: unknown,\n output: OpencodePluginSystemTransformOutput,\n ) => Promise<void>;\n}>;\n\nexport type PublishedSkillsResult = {\n directoryPath: string;\n workspaceResolution: WorkspaceResolution;\n fetchResult: FetchResult;\n};\n\nexport type PublishedSkillsIgnoreState = {\n scopeKey: string;\n userKey: string;\n ignoredSkillSlugs: string[];\n installedGlobalSkillSlugs: string[];\n installedWorkspaceSkillSlugs: string[];\n};\n\nexport type PublishedSkillPreferenceCacheContext = {\n userKey: string;\n preferenceVersion: number;\n};\n\nexport type FilteredPublishedSkillsResult = PublishedSkillsResult & {\n ignoreState: PublishedSkillsIgnoreState;\n ignoredSkills: PublishedSkillSummary[];\n};\n\nexport type PublishedSkillDetailResult =\n | {\n ok: true;\n detail: PublishedSkillDetail;\n }\n | {\n ok: false;\n status: 'not_found' | 'missing_auth' | 'request_failed';\n output: string;\n metadata: Record<string, string>;\n };\n\nexport type PluginAuthStateSummary = {\n status: 'missing' | 'authenticated';\n email: string | null;\n userId: string | null;\n role: 'ADMIN' | 'EDITOR' | null;\n authenticatedAt: string | null;\n expiresAt: string | null;\n};\n\nexport type PluginStatusSnapshot = {\n pluginId: string;\n runtimeMode: 'tool_fetch_only';\n nativeSkillsUrlCompatibility: NativeSkillsUrlCompatibility;\n backendOrigin: string;\n graphqlUrl: string;\n fallbackWorkspaceSlug: string;\n workspaceResolution: WorkspaceResolutionOutput;\n rootSkillSeedPath: string;\n authStatePath: string;\n authState: PluginAuthStateSummary;\n status: FetchResult['status'];\n authMode: FetchResult['authMode'];\n fetchedAt: string;\n source: FetchResult['source'];\n availableTools: string[];\n message: string | null;\n catalog: PublishedSkillsSuccessState | null;\n installableCatalog: {\n count: number;\n skills: PublishedSkillSummary[];\n } | null;\n ignoredPublishedSkills: {\n scopeKey: string;\n userKey: string;\n count: number;\n skills: PublishedSkillSummary[];\n };\n};\n\nexport type AiFacingIgnoredPublishedSkillsSummary = {\n scopeKey: string;\n count: number;\n};\n\nexport type AiFacingPluginStatusSnapshot = Omit<PluginStatusSnapshot, 'ignoredPublishedSkills' | 'installableCatalog'> & {\n ignoredPublishedSkills: AiFacingIgnoredPublishedSkillsSummary;\n};\n\nexport type OidcDiscoveryDocument = {\n authorization_endpoint: string;\n};\n\nexport type PluginSessionResponse = {\n success: true;\n session: {\n jwtToken: string;\n expiresAt: string;\n user: {\n id: string;\n email: string;\n role?: 'ADMIN' | 'EDITOR';\n };\n };\n};\n\nexport type OidcCallbackPayload =\n | {\n status: 'success';\n code: string;\n state: string;\n }\n | {\n status: 'error';\n message: string;\n };\n\nexport type OidcLoginStart = {\n browserUrl: string;\n expiresAt: string;\n codeVerifier: string;\n expectedState: string;\n callbackPromise: Promise<OidcCallbackPayload>;\n closeCallbackServer: () => Promise<void>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -7,7 +7,7 @@ import { setProp as _$setProp } from "@opentui/solid";
7
7
  import { createElement as _$createElement } from "@opentui/solid";
8
8
  import { createMemo } from 'solid-js';
9
9
  import { compactStatusMessage, formatAuthStatus, formatBackendOriginLabel, formatSkillsCatalogUnavailableMessage } from '../formatting.js';
10
- import { getInstallableNotInstalledSkills } from '../skill-helpers.js';
10
+ import { getInstallableNotInstalledSkills, getUserRoleRow } from '../skill-helpers.js';
11
11
  import { Row } from './common.js';
12
12
  export const StatusContent = props => {
13
13
  if (props.status.kind === 'loading') {
@@ -62,6 +62,7 @@ export const SkillsRows = props => {
62
62
  })();
63
63
  };
64
64
  export const ReadyRows = props => {
65
+ const roleRow = getUserRoleRow(props.snapshot);
65
66
  const statusRows = [_$createComponent(Row, {
66
67
  label: "url",
67
68
  get value() {
@@ -104,11 +105,25 @@ export const ReadyRows = props => {
104
105
  return props.theme.text;
105
106
  }
106
107
  }), null);
108
+ _$insert(_el$6, _$createComponent(Row, {
109
+ get label() {
110
+ return roleRow.label;
111
+ },
112
+ get value() {
113
+ return roleRow.value;
114
+ },
115
+ get labelColor() {
116
+ return props.theme.textMuted;
117
+ },
118
+ get valueColor() {
119
+ return props.theme.text;
120
+ }
121
+ }), null);
107
122
  return _el$6;
108
123
  })();
109
124
  }
110
125
  const installableNotInstalledCount = getInstallableNotInstalledSkills(props.snapshot).length;
111
- const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable · ${props.snapshot.ignoredPublishedSkills.count} ignored`;
126
+ const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable`;
112
127
  return (() => {
113
128
  var _el$7 = _$createElement("box");
114
129
  _$setProp(_el$7, "width", "100%");
@@ -125,6 +140,20 @@ export const ReadyRows = props => {
125
140
  return props.theme.text;
126
141
  }
127
142
  }), null);
143
+ _$insert(_el$7, _$createComponent(Row, {
144
+ get label() {
145
+ return roleRow.label;
146
+ },
147
+ get value() {
148
+ return roleRow.value;
149
+ },
150
+ get labelColor() {
151
+ return props.theme.textMuted;
152
+ },
153
+ get valueColor() {
154
+ return props.theme.text;
155
+ }
156
+ }), null);
128
157
  return _el$7;
129
158
  })();
130
159
  };
@@ -1 +1 @@
1
- {"version":3,"names":["createMemo","compactStatusMessage","formatAuthStatus","formatBackendOriginLabel","formatSkillsCatalogUnavailableMessage","getInstallableNotInstalledSkills","Row","StatusContent","props","status","kind","_el$","_$createElement","_$insertNode","_$createTextNode","_$setProp","_$effect","_$p","theme","textMuted","_el$3","_el$4","_$insert","message","warning","_$createComponent","ReadyRows","snapshot","SkillsRows","api","current","statusContent","currentStatus","_el$5","statusRows","label","value","backendOrigin","labelColor","valueColor","text","catalog","_el$6","installableNotInstalledCount","length","catalogStatus","publishedSkillCount","ignoredPublishedSkills","count","_el$7"],"sources":["../../../src/tui/components/status-content.tsx"],"sourcesContent":["import { createMemo } from 'solid-js';\nimport type { PluginStatusSnapshot } from '../../server.js';\nimport { compactStatusMessage, formatAuthStatus, formatBackendOriginLabel, formatSkillsCatalogUnavailableMessage } from '../formatting.js';\nimport { getInstallableNotInstalledSkills } from '../skill-helpers.js';\nimport type { StatusState, TuiPluginApi } from '../types.js';\nimport { Row } from './common.js';\n\nexport const StatusContent = (props: { status: StatusState; theme: TuiPluginApi['theme']['current'] }) => {\n if (props.status.kind === 'loading') {\n return (\n <text fg={props.theme.textMuted} wrapMode=\"none\" overflow=\"hidden\">\n loading…\n </text>\n );\n }\n\n if (props.status.kind === 'error') {\n return (\n <text fg={props.theme.warning} wrapMode=\"none\" overflow=\"hidden\">\n unavailable: {compactStatusMessage(props.status.message)}\n </text>\n );\n }\n\n return <ReadyRows snapshot={props.status.snapshot} theme={props.theme} />;\n};\n\nexport const SkillsRows = (props: { api: TuiPluginApi; status: () => StatusState }) => {\n const theme = createMemo(() => props.api.theme.current);\n const statusContent = () => {\n const currentStatus = props.status();\n\n return <StatusContent status={currentStatus} theme={theme()} />;\n };\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusContent()}\n </box>\n );\n};\n\nexport const ReadyRows = (props: { snapshot: PluginStatusSnapshot; theme: TuiPluginApi['theme']['current'] }) => {\n const statusRows = (\n <>\n <Row\n label=\"url\"\n value={formatBackendOriginLabel(props.snapshot.backendOrigin)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n <Row label=\"auth\" value={formatAuthStatus(props.snapshot)} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </>\n );\n\n if (!props.snapshot.catalog) {\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row\n label=\"catalog\"\n value={formatSkillsCatalogUnavailableMessage(props.snapshot)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n </box>\n );\n }\n\n const installableNotInstalledCount = getInstallableNotInstalledSkills(props.snapshot).length;\n const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable · ${props.snapshot.ignoredPublishedSkills.count} ignored`;\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row label=\"catalog\" value={catalogStatus} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </box>\n );\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,QAAQ,UAAU;AAErC,SAASC,oBAAoB,EAAEC,gBAAgB,EAAEC,wBAAwB,E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C,SAAS;MAAA;MAAA,IAAEoB,UAAUA,CAAA;QAAA,OAAE/B,KAAK,CAACU,KAAK,CAACsB,IAAI;MAAA;IAAA;IAAA,OAAAS,KAAA;EAAA;AAGhH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createMemo","compactStatusMessage","formatAuthStatus","formatBackendOriginLabel","formatSkillsCatalogUnavailableMessage","getInstallableNotInstalledSkills","getUserRoleRow","Row","StatusContent","props","status","kind","_el$","_$createElement","_$insertNode","_$createTextNode","_$setProp","_$effect","_$p","theme","textMuted","_el$3","_el$4","_$insert","message","warning","_$createComponent","ReadyRows","snapshot","SkillsRows","api","current","statusContent","currentStatus","_el$5","roleRow","statusRows","label","value","backendOrigin","labelColor","valueColor","text","catalog","_el$6","installableNotInstalledCount","length","catalogStatus","publishedSkillCount","_el$7"],"sources":["../../../src/tui/components/status-content.tsx"],"sourcesContent":["import { createMemo } from 'solid-js';\nimport type { PluginStatusSnapshot } from '../../server.js';\nimport { compactStatusMessage, formatAuthStatus, formatBackendOriginLabel, formatSkillsCatalogUnavailableMessage } from '../formatting.js';\nimport { getInstallableNotInstalledSkills, getUserRoleRow } from '../skill-helpers.js';\nimport type { StatusState, TuiPluginApi } from '../types.js';\nimport { Row } from './common.js';\n\nexport const StatusContent = (props: { status: StatusState; theme: TuiPluginApi['theme']['current'] }) => {\n if (props.status.kind === 'loading') {\n return (\n <text fg={props.theme.textMuted} wrapMode=\"none\" overflow=\"hidden\">\n loading…\n </text>\n );\n }\n\n if (props.status.kind === 'error') {\n return (\n <text fg={props.theme.warning} wrapMode=\"none\" overflow=\"hidden\">\n unavailable: {compactStatusMessage(props.status.message)}\n </text>\n );\n }\n\n return <ReadyRows snapshot={props.status.snapshot} theme={props.theme} />;\n};\n\nexport const SkillsRows = (props: { api: TuiPluginApi; status: () => StatusState }) => {\n const theme = createMemo(() => props.api.theme.current);\n const statusContent = () => {\n const currentStatus = props.status();\n\n return <StatusContent status={currentStatus} theme={theme()} />;\n };\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusContent()}\n </box>\n );\n};\n\nexport const ReadyRows = (props: { snapshot: PluginStatusSnapshot; theme: TuiPluginApi['theme']['current'] }) => {\n const roleRow = getUserRoleRow(props.snapshot);\n const statusRows = (\n <>\n <Row\n label=\"url\"\n value={formatBackendOriginLabel(props.snapshot.backendOrigin)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n <Row label=\"auth\" value={formatAuthStatus(props.snapshot)} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </>\n );\n\n if (!props.snapshot.catalog) {\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row\n label=\"catalog\"\n value={formatSkillsCatalogUnavailableMessage(props.snapshot)}\n labelColor={props.theme.textMuted}\n valueColor={props.theme.text}\n />\n <Row label={roleRow.label} value={roleRow.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </box>\n );\n }\n\n const installableNotInstalledCount = getInstallableNotInstalledSkills(props.snapshot).length;\n const catalogStatus = `${props.snapshot.catalog.publishedSkillCount} loaded · ${installableNotInstalledCount} installable`;\n\n return (\n <box width=\"100%\" flexDirection=\"column\" overflow=\"hidden\">\n {statusRows}\n <Row label=\"catalog\" value={catalogStatus} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n <Row label={roleRow.label} value={roleRow.value} labelColor={props.theme.textMuted} valueColor={props.theme.text} />\n </box>\n );\n};\n"],"mappings":";;;;;;;AAAA,SAASA,UAAU,QAAQ,UAAU;AAErC,SAASC,oBAAoB,EAAEC,gBAAgB,EAAEC,wBAAwB,EAAEC,qCAAqC,QAAQ,kBAAkB;AAC1I,SAASC,gCAAgC,EAAEC,cAAc,QAAQ,qBAAqB;AAEtF,SAASC,GAAG,QAAQ,aAAa;AAEjC,OAAO,MAAMC,aAAa,GAAIC,KAAuE,IAAK;EACxG,IAAIA,KAAK,CAACC,MAAM,CAACC,IAAI,KAAK,SAAS,EAA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b,QAAA,CAAA0B,KAAA,EAAAvB,iBAAA,CACVnB,GAAG;MAAC8B,KAAK;MAAWC,KAAK,EAAES,aAAa;MAAA,IAAEP,UAAUA,CAAA;QAAA,OAAE/B,KAAK,CAACU,KAAK,CAACC,SAAS;MAAA;MAAA,IAAEqB,UAAUA,CAAA;QAAA,OAAEhC,KAAK,CAACU,KAAK,CAACuB,IAAI;MAAA;IAAA;IAAAnB,QAAA,CAAA0B,KAAA,EAAAvB,iBAAA,CACzGnB,GAAG;MAAA,IAAC8B,KAAKA,CAAA;QAAA,OAAEF,OAAO,CAACE,KAAK;MAAA;MAAA,IAAEC,KAAKA,CAAA;QAAA,OAAEH,OAAO,CAACG,KAAK;MAAA;MAAA,IAAEE,UAAUA,CAAA;QAAA,OAAE/B,KAAK,CAACU,KAAK,CAACC,SAAS;MAAA;MAAA,IAAEqB,UAAUA,CAAA;QAAA,OAAEhC,KAAK,CAACU,KAAK,CAACuB,IAAI;MAAA;IAAA;IAAA,OAAAO,KAAA;EAAA;AAGtH,CAAC","ignoreList":[]}
@@ -13,10 +13,9 @@ export const formatSkillsCatalogUnavailableMessage = snapshot => {
13
13
  return 'unavailable';
14
14
  };
15
15
  export const formatAuthStatus = snapshot => {
16
- const roleLabel = snapshot.authState.role ? ` [${snapshot.authState.role}]` : '';
17
- if (snapshot.authState.status !== 'authenticated') return `${snapshot.authState.status}${roleLabel}`;
18
- if (!snapshot.authState.email) return `authenticated${roleLabel}`;
19
- return `${snapshot.authState.email}${roleLabel}`;
16
+ if (snapshot.authState.status !== 'authenticated') return snapshot.authState.status;
17
+ if (!snapshot.authState.email) return 'authenticated';
18
+ return snapshot.authState.email;
20
19
  };
21
20
  export const formatBackendOriginLabel = backendOrigin => {
22
21
  try {
@@ -1 +1 @@
1
- {"version":3,"names":["MAX_STATUS_MESSAGE_LENGTH","compactStatusMessage","message","length","slice","formatSkillsCatalogUnavailableMessage","snapshot","catalog","status","formatAuthStatus","roleLabel","authState","role","email","formatBackendOriginLabel","backendOrigin","hostname","URL","includes"],"sources":["../../src/tui/formatting.ts"],"sourcesContent":["import type { PluginStatusSnapshot } from '../server.js';\nimport { MAX_STATUS_MESSAGE_LENGTH } from './constants.js';\n\nexport const compactStatusMessage = (message: string): string => {\n if (message.length <= MAX_STATUS_MESSAGE_LENGTH) return message;\n\n return `${message.slice(0, MAX_STATUS_MESSAGE_LENGTH - 1)}…`;\n};\n\nexport const formatSkillsCatalogUnavailableMessage = (snapshot: PluginStatusSnapshot): string => {\n if (!snapshot.catalog && snapshot.status === 'missing_auth') {\n if (snapshot.message) return compactStatusMessage(snapshot.message);\n\n return 'locked (browser auth pending)';\n }\n\n if (!snapshot.catalog && snapshot.message) return compactStatusMessage(snapshot.message);\n if (!snapshot.catalog) return `unavailable (${snapshot.status})`;\n\n return 'unavailable';\n};\n\nexport const formatAuthStatus = (snapshot: PluginStatusSnapshot): string => {\n const roleLabel = snapshot.authState.role ? ` [${snapshot.authState.role}]` : '';\n if (snapshot.authState.status !== 'authenticated') return `${snapshot.authState.status}${roleLabel}`;\n if (!snapshot.authState.email) return `authenticated${roleLabel}`;\n\n return `${snapshot.authState.email}${roleLabel}`;\n};\n\nexport const formatBackendOriginLabel = (backendOrigin: string): string => {\n try {\n const { hostname } = new URL(backendOrigin);\n if (hostname === 'localhost' || hostname === '127.0.0.1') return 'localhost';\n\n return 'opencode-wizard';\n } catch {\n if (backendOrigin.includes('localhost') || backendOrigin.includes('127.0.0.1')) return 'localhost';\n\n return 'opencode-wizard';\n }\n};\n"],"mappings":"AACA,SAASA,yBAAyB,QAAQ,gBAAgB;AAE1D,OAAO,MAAMC,oBAAoB,GAAIC,OAAe,IAAa;EAC/D,IAAIA,OAAO,CAACC,MAAM,IAAIH,yBAAyB,EAAE,OAAOE,OAAO;EAE/D,OAAO,GAAGA,OAAO,CAACE,KAAK,CAAC,CAAC,EAAEJ,yBAAyB,GAAG,CAAC,CAAC,GAAG;AAC9D,CAAC;AAED,OAAO,MAAMK,qCAAqC,GAA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QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,WAAW;IAElG,OAAO,iBAAiB;EAC1B;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["MAX_STATUS_MESSAGE_LENGTH","compactStatusMessage","message","length","slice","formatSkillsCatalogUnavailableMessage","snapshot","catalog","status","formatAuthStatus","authState","email","formatBackendOriginLabel","backendOrigin","hostname","URL","includes"],"sources":["../../src/tui/formatting.ts"],"sourcesContent":["import type { PluginStatusSnapshot } from '../server.js';\nimport { MAX_STATUS_MESSAGE_LENGTH } from './constants.js';\n\nexport const compactStatusMessage = (message: string): string => {\n if (message.length <= MAX_STATUS_MESSAGE_LENGTH) return message;\n\n return `${message.slice(0, MAX_STATUS_MESSAGE_LENGTH - 1)}…`;\n};\n\nexport const formatSkillsCatalogUnavailableMessage = (snapshot: PluginStatusSnapshot): string => {\n if (!snapshot.catalog && snapshot.status === 'missing_auth') {\n if (snapshot.message) return compactStatusMessage(snapshot.message);\n\n return 'locked (browser auth pending)';\n }\n\n if (!snapshot.catalog && snapshot.message) return compactStatusMessage(snapshot.message);\n if (!snapshot.catalog) return `unavailable (${snapshot.status})`;\n\n return 'unavailable';\n};\n\nexport const formatAuthStatus = (snapshot: PluginStatusSnapshot): string => {\n if (snapshot.authState.status !== 'authenticated') return snapshot.authState.status;\n if (!snapshot.authState.email) return 'authenticated';\n\n return snapshot.authState.email;\n};\n\nexport const formatBackendOriginLabel = (backendOrigin: string): string => {\n try {\n const { hostname } = new URL(backendOrigin);\n if (hostname === 'localhost' || hostname === '127.0.0.1') return 'localhost';\n\n return 'opencode-wizard';\n } catch {\n if (backendOrigin.includes('localhost') || backendOrigin.includes('127.0.0.1')) return 'localhost';\n\n return 'opencode-wizard';\n }\n};\n"],"mappings":"AACA,SAASA,yBAAyB,QAAQ,gBAAgB;AAE1D,OAAO,MAAMC,oBAAoB,GAAIC,OAAe,IAAa;EAC/D,IAAIA,OAAO,CAACC,MAAM,IAAIH,yBAAyB,EAAE,OAAOE,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AAO,iBAAiB;EAC1B;AACF,CAAC","ignoreList":[]}
@@ -3,10 +3,99 @@ import { STATUS_REFRESH_INTERVAL_MS } from './constants.js';
3
3
  import { requestRender } from './rendering.js';
4
4
  import { createWizardStatusSlot } from './slots.js';
5
5
  import { loadStatus } from './status.js';
6
+ const registerCommandActions = (api, actions) => {
7
+ const commandProvider = () => actions;
8
+ if (api.command?.register) {
9
+ return {
10
+ unregister: api.command.register(commandProvider) ?? null
11
+ };
12
+ }
13
+ if (api.commands?.register) {
14
+ return {
15
+ unregister: api.commands.register(commandProvider) ?? null
16
+ };
17
+ }
18
+ return null;
19
+ };
20
+ const createSharedSkillActions = refreshStatus => [{
21
+ value: 'opencode-wizard.status',
22
+ title: 'Wizard: status',
23
+ description: 'Refresh plugin auth, backend, catalog, source, and workspace-resolution status via opencode_wizard_status.',
24
+ category: 'Wizard',
25
+ slash: {
26
+ name: 'wizard-status'
27
+ },
28
+ onSelect: () => refreshStatus({
29
+ showLoading: true
30
+ })
31
+ }, {
32
+ value: 'opencode-wizard.fetch-published-skill',
33
+ title: 'Wizard: fetch published skill',
34
+ description: 'Fetch wizard-listed skill bodies/details with opencode_wizard_published_skills_fetch; pass refresh: true for fresh backend data.',
35
+ category: 'Wizard',
36
+ slash: {
37
+ name: 'wizard-fetch-skill'
38
+ },
39
+ onSelect: () => refreshStatus({
40
+ showLoading: true
41
+ })
42
+ }, {
43
+ value: 'opencode-wizard.manage-skill-preference',
44
+ title: 'Wizard: manage skill preference',
45
+ description: 'Use opencode_wizard_published_skill_preference_set to install, uninstall, ignore, or unignore a published skill for project/global scope.',
46
+ category: 'Wizard',
47
+ slash: {
48
+ name: 'wizard-manage-skill'
49
+ },
50
+ onSelect: () => refreshStatus({
51
+ showLoading: true
52
+ })
53
+ }];
54
+ const createEditorSkillActions = refreshStatus => [{
55
+ value: 'opencode-wizard.editor.create-or-update-skill',
56
+ title: 'Wizard: create/update skill from markdown',
57
+ description: 'Canonical EDITOR flow: call opencode_wizard_editor_create_or_update_skill with complete SKILL.md markdownContent; no local seed file required.',
58
+ category: 'Wizard',
59
+ slash: {
60
+ name: 'wizard-create-skill'
61
+ },
62
+ onSelect: () => refreshStatus({
63
+ showLoading: true
64
+ })
65
+ }, {
66
+ value: 'opencode-wizard.editor.import-artifact',
67
+ title: 'Wizard: import external artifact',
68
+ description: 'External source flow: call opencode_wizard_artifact_import for SKILL or DESIGN_DOC URLs/command-like sources; no project files are written.',
69
+ category: 'Wizard',
70
+ slash: {
71
+ name: 'wizard-import-artifact'
72
+ },
73
+ onSelect: () => refreshStatus({
74
+ showLoading: true
75
+ })
76
+ }, {
77
+ value: 'opencode-wizard.editor.publish-seed-skill',
78
+ title: 'Wizard: publish local seed skill',
79
+ description: 'Legacy seed flow: call opencode_wizard_editor_publish_skill for .opencode/skills/<slug>/SKILL.md when a local seed already exists.',
80
+ category: 'Wizard',
81
+ slash: {
82
+ name: 'wizard-publish-seed'
83
+ },
84
+ onSelect: () => refreshStatus({
85
+ showLoading: true
86
+ })
87
+ }];
88
+ const registerSkillActions = (api, refreshStatus, mode) => {
89
+ const sharedActions = createSharedSkillActions(refreshStatus);
90
+ const actions = mode === 'editor' ? [...sharedActions, ...createEditorSkillActions(refreshStatus)] : sharedActions;
91
+ return registerCommandActions(api, actions);
92
+ };
6
93
  export const tui = async api => {
7
94
  const [status, setStatus] = createSignal({
8
95
  kind: 'loading'
9
96
  });
97
+ let registeredActionMode = null;
98
+ let commandRegistration = null;
10
99
  const refreshStatus = options => {
11
100
  if (options?.showLoading) {
12
101
  setStatus({
@@ -16,6 +105,14 @@ export const tui = async api => {
16
105
  }
17
106
  void loadStatus(api).then(nextStatus => {
18
107
  setStatus(nextStatus);
108
+ if (nextStatus.kind === 'ready') {
109
+ const nextMode = nextStatus.snapshot.availableTools.includes('opencode_wizard_editor_create_or_update_skill') ? 'editor' : 'shared';
110
+ if (registeredActionMode !== nextMode) {
111
+ commandRegistration?.unregister?.();
112
+ commandRegistration = registerSkillActions(api, refreshStatus, nextMode);
113
+ registeredActionMode = commandRegistration ? nextMode : null;
114
+ }
115
+ }
19
116
  requestRender(api);
20
117
  });
21
118
  };
@@ -1 +1 @@
1
- {"version":3,"names":["createSignal","STATUS_REFRESH_INTERVAL_MS","requestRender","createWizardStatusSlot","loadStatus","tui","api","status","setStatus","kind","refreshStatus","options","showLoading","then","nextStatus","slots","register","setInterval"],"sources":["../../src/tui/plugin.ts"],"sourcesContent":["import { createSignal } from 'solid-js';\nimport { STATUS_REFRESH_INTERVAL_MS } from './constants.js';\nimport { requestRender } from './rendering.js';\nimport { createWizardStatusSlot } from './slots.js';\nimport { loadStatus } from './status.js';\nimport type { RefreshStatus, StatusState, TuiPlugin } from './types.js';\n\nexport const tui: TuiPlugin = async (api) => {\n const [status, setStatus] = createSignal<StatusState>({ kind: 'loading' });\n const refreshStatus: RefreshStatus = (options) => {\n if (options?.showLoading) {\n setStatus({ kind: 'loading' });\n requestRender(api);\n }\n\n void loadStatus(api).then((nextStatus) => {\n setStatus(nextStatus);\n requestRender(api);\n });\n };\n\n api.slots.register(createWizardStatusSlot(api, status, refreshStatus));\n refreshStatus();\n setInterval(refreshStatus, STATUS_REFRESH_INTERVAL_MS);\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,UAAU;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAC3D,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,sBAAsB,QAAQ,YAAY;AACnD,SAASC,UAAU,QAAQ,aAAa;AAGxC,OAAO,MAAMC,GAAc,GAAG,MAAOC,GAAG,IAAK;EAC3C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGR,YAAY,CAAc;IAAES,IAAI,EAAE;EAAU,CAAC,CAAC;EAC1E,MAAMC,aAA4B,GAAIC,OAAO,IAAK;IAChD,IAAIA,OAAO,EAAEC,WAAW,EAAE;MACxBJ,SAAS,CAAC;QAAEC,IAAI,EAAE;MAAU,CAAC,CAAC;MAC9BP,aAAa,CAACI,GAAG,CAAC;IACpB;IAEA,KAAKF,UAAU,CAACE,GAAG,CAAC,CAACO,IAAI,CAAEC,UAAU,IAAK;MACxCN,SAAS,CAACM,UAAU,CAAC;MACrBZ,aAAa,CAACI,GAAG,CAAC;IACpB,CAAC,CAAC;EACJ,CAAC;EAEDA,GAAG,CAACS,KAAK,CAACC,QAAQ,CAACb,sBAAsB,CAACG,GAAG,EAAEC,MAAM,EAAEG,aAAa,CAAC,CAAC;EACtEA,aAAa,CAAC,CAAC;EACfO,WAAW,CAACP,aAAa,EAAET,0BAA0B,CAAC;AACxD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createSignal","STATUS_REFRESH_INTERVAL_MS","requestRender","createWizardStatusSlot","loadStatus","registerCommandActions","api","actions","commandProvider","command","register","unregister","commands","createSharedSkillActions","refreshStatus","value","title","description","category","slash","name","onSelect","showLoading","createEditorSkillActions","registerSkillActions","mode","sharedActions","tui","status","setStatus","kind","registeredActionMode","commandRegistration","options","then","nextStatus","nextMode","snapshot","availableTools","includes","slots","setInterval"],"sources":["../../src/tui/plugin.ts"],"sourcesContent":["import { createSignal } from 'solid-js';\nimport { STATUS_REFRESH_INTERVAL_MS } from './constants.js';\nimport { requestRender } from './rendering.js';\nimport { createWizardStatusSlot } from './slots.js';\nimport { loadStatus } from './status.js';\nimport type { RefreshStatus, StatusState, TuiCommand, TuiPlugin, TuiPluginApi } from './types.js';\n\ntype RegisteredActionMode = 'shared' | 'editor';\ntype CommandRegistration = {\n unregister: (() => void) | null;\n};\n\nconst registerCommandActions = (api: TuiPluginApi, actions: TuiCommand[]): CommandRegistration | null => {\n const commandProvider = () => actions;\n\n if (api.command?.register) {\n return { unregister: api.command.register(commandProvider) ?? null };\n }\n\n if (api.commands?.register) {\n return { unregister: api.commands.register(commandProvider) ?? null };\n }\n\n return null;\n};\n\nconst createSharedSkillActions = (refreshStatus: RefreshStatus): TuiCommand[] => [\n {\n value: 'opencode-wizard.status',\n title: 'Wizard: status',\n description: 'Refresh plugin auth, backend, catalog, source, and workspace-resolution status via opencode_wizard_status.',\n category: 'Wizard',\n slash: {\n name: 'wizard-status',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.fetch-published-skill',\n title: 'Wizard: fetch published skill',\n description: 'Fetch wizard-listed skill bodies/details with opencode_wizard_published_skills_fetch; pass refresh: true for fresh backend data.',\n category: 'Wizard',\n slash: {\n name: 'wizard-fetch-skill',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.manage-skill-preference',\n title: 'Wizard: manage skill preference',\n description:\n 'Use opencode_wizard_published_skill_preference_set to install, uninstall, ignore, or unignore a published skill for project/global scope.',\n category: 'Wizard',\n slash: {\n name: 'wizard-manage-skill',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n];\n\nconst createEditorSkillActions = (refreshStatus: RefreshStatus): TuiCommand[] => [\n {\n value: 'opencode-wizard.editor.create-or-update-skill',\n title: 'Wizard: create/update skill from markdown',\n description:\n 'Canonical EDITOR flow: call opencode_wizard_editor_create_or_update_skill with complete SKILL.md markdownContent; no local seed file required.',\n category: 'Wizard',\n slash: {\n name: 'wizard-create-skill',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.editor.import-artifact',\n title: 'Wizard: import external artifact',\n description:\n 'External source flow: call opencode_wizard_artifact_import for SKILL or DESIGN_DOC URLs/command-like sources; no project files are written.',\n category: 'Wizard',\n slash: {\n name: 'wizard-import-artifact',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n {\n value: 'opencode-wizard.editor.publish-seed-skill',\n title: 'Wizard: publish local seed skill',\n description:\n 'Legacy seed flow: call opencode_wizard_editor_publish_skill for .opencode/skills/<slug>/SKILL.md when a local seed already exists.',\n category: 'Wizard',\n slash: {\n name: 'wizard-publish-seed',\n },\n onSelect: () => refreshStatus({ showLoading: true }),\n },\n];\n\nconst registerSkillActions = (\n api: TuiPluginApi,\n refreshStatus: RefreshStatus,\n mode: RegisteredActionMode,\n): CommandRegistration | null => {\n const sharedActions = createSharedSkillActions(refreshStatus);\n const actions = mode === 'editor' ? [...sharedActions, ...createEditorSkillActions(refreshStatus)] : sharedActions;\n\n return registerCommandActions(api, actions);\n};\n\nexport const tui: TuiPlugin = async (api) => {\n const [status, setStatus] = createSignal<StatusState>({ kind: 'loading' });\n let registeredActionMode: RegisteredActionMode | null = null;\n let commandRegistration: CommandRegistration | null = null;\n const refreshStatus: RefreshStatus = (options) => {\n if (options?.showLoading) {\n setStatus({ kind: 'loading' });\n requestRender(api);\n }\n\n void loadStatus(api).then((nextStatus) => {\n setStatus(nextStatus);\n if (nextStatus.kind === 'ready') {\n const nextMode: RegisteredActionMode = nextStatus.snapshot.availableTools.includes(\n 'opencode_wizard_editor_create_or_update_skill',\n )\n ? 'editor'\n : 'shared';\n if (registeredActionMode !== nextMode) {\n commandRegistration?.unregister?.();\n commandRegistration = registerSkillActions(api, refreshStatus, nextMode);\n registeredActionMode = commandRegistration ? nextMode : null;\n }\n }\n requestRender(api);\n });\n };\n\n api.slots.register(createWizardStatusSlot(api, status, refreshStatus));\n refreshStatus();\n setInterval(refreshStatus, STATUS_REFRESH_INTERVAL_MS);\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,UAAU;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAC3D,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,sBAAsB,QAAQ,YAAY;AACnD,SAASC,UAAU,QAAQ,aAAa;AAQxC,MAAMC,sBAAsB,GAAGA,CAACC,GAAiB,EAAEC,OAAqB,KAAiC;EACvG,MAAMC,eAAe,GAAGA,CAAA,KAAMD,OAAO;EAErC,IAAID,GAAG,CAACG,OAAO,EAAEC,QAAQ,EAAE;IACzB,OAAO;MAAEC,UAAU,EAAEL,GAAG,CAACG,OAAO,CAACC,QAAQ,CAACF,eAAe,CAAC,IAAI;IAAK,CAAC;EACtE;EAEA,IAAIF,GAAG,CA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;MAAU,CAAC,CAAC;MAC9B5B,aAAa,CAACI,GAAG,CAAC;IACpB;IAEA,KAAKF,UAAU,CAACE,GAAG,CAAC,CAAC4B,IAAI,CAAEC,UAAU,IAAK;MACxCN,SAAS,CAACM,UAAU,CAAC;MACrB,IAAIA,UAAU,CAACL,IAAI,KAAK,OAAO,EAAE;QAC/B,MAAMM,QAA8B,GAAGD,UAAU,CAACE,QAAQ,CAACC,cAAc,CAACC,QAAQ,CAChF,+CACF,CAAC,GACG,QAAQ,GACR,QAAQ;QACZ,IAAIR,oBAAoB,KAAKK,QAAQ,EAAE;UACrCJ,mBAAmB,EAAErB,UAAU,GAAG,CAAC;UACnCqB,mBAAmB,GAAGR,oBAAoB,CAAClB,GAAG,EAAEQ,aAAa,EAAEsB,QAAQ,CAAC;UACxEL,oBAAoB,GAAGC,mBAAmB,GAAGI,QAAQ,GAAG,IAAI;QAC9D;MACF;MACAlC,aAAa,CAACI,GAAG,CAAC;IACpB,CAAC,CAAC;EACJ,CAAC;EAEDA,GAAG,CAACkC,KAAK,CAAC9B,QAAQ,CAACP,sBAAsB,CAACG,GAAG,EAAEsB,MAAM,EAAEd,aAAa,CAAC,CAAC;EACtEA,aAAa,CAAC,CAAC;EACf2B,WAAW,CAAC3B,aAAa,EAAEb,0BAA0B,CAAC;AACxD,CAAC","ignoreList":[]}
@@ -1,3 +1,10 @@
1
1
  import type { PluginStatusSnapshot } from '../server.js';
2
2
  import type { PublishedSkillSummary } from './types.js';
3
3
  export declare const getInstallableNotInstalledSkills: (snapshot: PluginStatusSnapshot) => PublishedSkillSummary[];
4
+ export type SkillListRow = {
5
+ label: string;
6
+ value: string;
7
+ };
8
+ export declare const getUserRoleRow: (snapshot: PluginStatusSnapshot) => SkillListRow;
9
+ export declare const getSkillListRows: (snapshot: PluginStatusSnapshot) => SkillListRow[];
10
+ export declare const getSkillActionRows: (snapshot: PluginStatusSnapshot) => SkillListRow[];