@aexol/opencode-wizard 0.4.8 → 0.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.
@@ -12,6 +12,7 @@ export type ResolvedConfig = {
12
12
  rootSkillSeedPath: string;
13
13
  authStatePath: string;
14
14
  };
15
+ export type PluginEventSource = 'OPENCODE' | 'PI';
15
16
  export type WorkspaceResolution = {
16
17
  requestedDirectory: string;
17
18
  repositoryRoot: string;
@@ -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 RecommendationMetadata = {\n relevance?: number | null;\n recommendationReason?: string | null;\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 EditorSkillWorkspaceAssignmentLookupResponse = {\n admin: {\n skill: { id: string; slug: string } | null;\n workspace: { id: string; slug: string } | null;\n };\n};\n\nexport type BulkCreateSkillAssignmentsResponse = {\n admin: {\n bulkCreateSkillAssignments: {\n scopePathAssignments: Array<{ id: string }>;\n skippedScopePathAssignments: Array<{ id: string }>;\n conflicts: Array<{\n target: string;\n inputIndex: number;\n reason: string;\n message: string;\n }>;\n };\n };\n};\n\nexport type EditorSkillWorkspaceAssignmentResult = {\n status: 'created' | 'already_exists' | 'skipped' | 'failed';\n workspaceSlug?: string | null;\n workspaceId?: string | null;\n directoryPath: string;\n assignmentId?: string | null;\n message?: string | null;\n};\n\nexport type ImportWizardArtifactSnapshotResponse = {\n admin: {\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};\n\nexport type SetPublishedSkillPreferenceResponse = {\n setPublishedSkillPreference: PublishedSkillUserPreferences;\n};\n\nexport type PublishedSkillInstallableCatalogItem = RecommendationMetadata &\n Pick<PublishedSkillCatalogItem, 'skill' | 'skillVersion' | 'publishedArtifact'>;\n\nexport type PublishedSkillCatalogItem = RecommendationMetadata & {\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 = RecommendationMetadata &\n Pick<WizardArtifactCatalogItem, 'artifact' | 'artifactVersion'>;\n\nexport type WizardArtifactCatalogItem = RecommendationMetadata & {\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 path?: Array<string | number>;\n extensions?: {\n code?: string;\n } & Record<string, unknown>;\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 CurrentUserRoleResponse = {\n user?: {\n me?: {\n _id: string;\n email: string;\n role: 'ADMIN' | 'EDITOR';\n } | null;\n } | 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 graphQlErrors?: 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 globalSkillManagementHint: 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 PluginEventSource = 'OPENCODE' | 'PI';\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 RecommendationMetadata = {\n relevance?: number | null;\n recommendationReason?: string | null;\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 EditorSkillWorkspaceAssignmentLookupResponse = {\n admin: {\n skill: { id: string; slug: string } | null;\n workspace: { id: string; slug: string } | null;\n };\n};\n\nexport type BulkCreateSkillAssignmentsResponse = {\n admin: {\n bulkCreateSkillAssignments: {\n scopePathAssignments: Array<{ id: string }>;\n skippedScopePathAssignments: Array<{ id: string }>;\n conflicts: Array<{\n target: string;\n inputIndex: number;\n reason: string;\n message: string;\n }>;\n };\n };\n};\n\nexport type EditorSkillWorkspaceAssignmentResult = {\n status: 'created' | 'already_exists' | 'skipped' | 'failed';\n workspaceSlug?: string | null;\n workspaceId?: string | null;\n directoryPath: string;\n assignmentId?: string | null;\n message?: string | null;\n};\n\nexport type ImportWizardArtifactSnapshotResponse = {\n admin: {\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};\n\nexport type SetPublishedSkillPreferenceResponse = {\n setPublishedSkillPreference: PublishedSkillUserPreferences;\n};\n\nexport type PublishedSkillInstallableCatalogItem = RecommendationMetadata &\n Pick<PublishedSkillCatalogItem, 'skill' | 'skillVersion' | 'publishedArtifact'>;\n\nexport type PublishedSkillCatalogItem = RecommendationMetadata & {\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 = RecommendationMetadata &\n Pick<WizardArtifactCatalogItem, 'artifact' | 'artifactVersion'>;\n\nexport type WizardArtifactCatalogItem = RecommendationMetadata & {\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 path?: Array<string | number>;\n extensions?: {\n code?: string;\n } & Record<string, unknown>;\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 CurrentUserRoleResponse = {\n user?: {\n me?: {\n _id: string;\n email: string;\n role: 'ADMIN' | 'EDITOR';\n } | null;\n } | 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 graphQlErrors?: 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 globalSkillManagementHint: 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":[]}
@@ -4,7 +4,9 @@ export const OpencodeWizardSkillsPlugin = async input => {
4
4
  const {
5
5
  tool
6
6
  } = await importOpencodePluginModule('@opencode-ai/plugin');
7
- return createWizardRuntime(input, tool);
7
+ return createWizardRuntime(input, tool, {
8
+ eventSource: 'OPENCODE'
9
+ });
8
10
  };
9
11
  export default {
10
12
  id: PLUGIN_ID,
@@ -1 +1 @@
1
- {"version":3,"names":["createWizardRuntime","PLUGIN_ID","importOpencodePluginModule","Function","OpencodeWizardSkillsPlugin","input","tool","id","server"],"sources":["../src/server-opencode.ts"],"sourcesContent":["import { createWizardRuntime, PLUGIN_ID } from './server/runtime.js';\nimport type { OpencodePluginModule, OpencodePluginServer } from './server/types.js';\n\nconst importOpencodePluginModule = new Function('specifier', 'return import(specifier)') as (\n specifier: string,\n) => Promise<OpencodePluginModule>;\n\nexport const OpencodeWizardSkillsPlugin: OpencodePluginServer = async (input) => {\n const { tool } = await importOpencodePluginModule('@opencode-ai/plugin');\n return createWizardRuntime(input, tool);\n};\n\nexport default {\n id: PLUGIN_ID,\n server: OpencodeWizardSkillsPlugin,\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,SAAS,QAAQ,qBAAqB;AAGpE,MAAMC,0BAA0B,GAAG,IAAIC,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAErD;AAElC,OAAO,MAAMC,0BAAgD,GAAG,MAAOC,KAAK,IAAK;EAC/E,MAAM;IAAEC;EAAK,CAAC,GAAG,MAAMJ,0BAA0B,CAAC,qBAAqB,CAAC;EACxE,OAAOF,mBAAmB,CAACK,KAAK,EAAEC,IAAI,CAAC;AACzC,CAAC;AAED,eAAe;EACbC,EAAE,EAAEN,SAAS;EACbO,MAAM,EAAEJ;AACV,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createWizardRuntime","PLUGIN_ID","importOpencodePluginModule","Function","OpencodeWizardSkillsPlugin","input","tool","eventSource","id","server"],"sources":["../src/server-opencode.ts"],"sourcesContent":["import { createWizardRuntime, PLUGIN_ID } from './server/runtime.js';\nimport type { OpencodePluginModule, OpencodePluginServer } from './server/types.js';\n\nconst importOpencodePluginModule = new Function('specifier', 'return import(specifier)') as (\n specifier: string,\n) => Promise<OpencodePluginModule>;\n\nexport const OpencodeWizardSkillsPlugin: OpencodePluginServer = async (input) => {\n const { tool } = await importOpencodePluginModule('@opencode-ai/plugin');\n return createWizardRuntime(input, tool, { eventSource: 'OPENCODE' });\n};\n\nexport default {\n id: PLUGIN_ID,\n server: OpencodeWizardSkillsPlugin,\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,SAAS,QAAQ,qBAAqB;AAGpE,MAAMC,0BAA0B,GAAG,IAAIC,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAErD;AAElC,OAAO,MAAMC,0BAAgD,GAAG,MAAOC,KAAK,IAAK;EAC/E,MAAM;IAAEC;EAAK,CAAC,GAAG,MAAMJ,0BAA0B,CAAC,qBAAqB,CAAC;EACxE,OAAOF,mBAAmB,CAACK,KAAK,EAAEC,IAAI,EAAE;IAAEC,WAAW,EAAE;EAAW,CAAC,CAAC;AACtE,CAAC;AAED,eAAe;EACbC,EAAE,EAAEP,SAAS;EACbQ,MAAM,EAAEL;AACV,CAAC","ignoreList":[]}
package/dist/server-pi.js CHANGED
@@ -150,7 +150,9 @@ const getRuntime = directory => {
150
150
  const runtime = createWizardRuntime({
151
151
  worktree: directory,
152
152
  directory
153
- }, createPiRuntimeToolFactory());
153
+ }, createPiRuntimeToolFactory(), {
154
+ eventSource: 'PI'
155
+ });
154
156
  runtimeCache.set(key, runtime);
155
157
  return runtime;
156
158
  };
@@ -1 +1 @@
1
- {"version":3,"names":["createWizardRuntime","PLUGIN_ID","createSchemaValue","optional","describe","createPiRuntimeToolFactory","createTool","definition","description","execute","args","context","tool","Object","assign","schema","string","boolean","runtimeCache","Map","directorySchema","type","properties","directory","catalogSchema","artifactKind","refresh","recommendationContext","artifactFetchSchema","artifact","artifacts","artifactPreferenceSchema","action","preferenceScope","required","publishedSkillsFetchSchema","skill","skills","publishedSkillPreferenceSchema","piToOpencodeToolNames","wizard_status","wizard_catalog_fetch","wizard_artifact_fetch","wizard_artifact_preference_set","wizard_published_skills_fetch","wizard_published_skill_preference_set","opencodeToPiToolNames","fromEntries","entries","map","piName","opencodeName","textResult","text","details","content","getStringParam","params","key","undefined","value","trimmed","trim","toJsonObject","Array","isArray","isExecutableTool","candidate","getRuntime","existingRuntime","get","runtime","worktree","set","toToolContext","toolCallId","sessionID","process","pid","messageID","agent","abort","AbortSignal","timeout","metadata","toPiResult","toolName","result","source","outputResult","output","JSON","stringify","toErrorMessage","error","Error","message","executeOpencodeTool","opencodeToolName","cwd","status","createBridgeTool","name","label","promptSnippet","promptGuidelines","parameters","buildPiTools","appendSystemNotes","systemPrompt","notes","normalizedNotes","note","filter","Boolean","length","missingNotes","includes","trimEnd","join","toPiSystemNote","piNote","replaceAll","buildSystemPrompt","event","system","failureNote","opencodeWizardPiExtension","pi","registerTool","on"],"sources":["../src/server-pi.ts"],"sourcesContent":["import { createWizardRuntime, PLUGIN_ID } from './server/runtime.js';\nimport type { ToolDefinition, ToolFactory } from './plugin-tools.js';\n\ntype JsonObject = Record<string, unknown>;\n\ntype PiToolResult = {\n content: Array<{ type: 'text'; text: string }>;\n details: JsonObject;\n};\n\ntype PiParamSchema = {\n type: 'object';\n properties: Record<string, unknown>;\n required?: string[];\n};\n\ntype PiToolDefinition = {\n name: string;\n label: string;\n description: string;\n promptSnippet?: string;\n promptGuidelines?: string[];\n parameters: PiParamSchema;\n execute: (toolCallId: string, params: unknown) => Promise<PiToolResult>;\n};\n\ntype BeforeAgentStartEvent = {\n systemPrompt: string;\n};\n\ntype PiExtensionApi = {\n registerTool: (tool: PiToolDefinition) => void;\n on: (event: 'before_agent_start', handler: (event: BeforeAgentStartEvent) => Promise<{ systemPrompt: string }>) => void;\n};\n\ntype OpencodeToolResult =\n | string\n | {\n output: string;\n metadata?: JsonObject;\n };\n\ntype OpencodeToolContext = {\n sessionID: string;\n messageID: string;\n agent: string;\n directory: string;\n worktree: string;\n abort: AbortSignal;\n metadata: (input: { title?: string; metadata?: JsonObject }) => void;\n};\n\ntype OpencodeExecutableTool = {\n description: string;\n execute: (args: JsonObject, context: OpencodeToolContext) => Promise<unknown>;\n};\n\ntype RuntimeEntry = Awaited<ReturnType<typeof createWizardRuntime>>;\n\ntype SchemaValue = {\n optional: () => SchemaValue;\n describe: (description: string) => SchemaValue;\n};\n\nconst createSchemaValue = (): SchemaValue => ({\n optional: createSchemaValue,\n describe: createSchemaValue,\n});\n\nconst createPiRuntimeToolFactory = (): ToolFactory => {\n const createTool = <TArgs extends object>(definition: ToolDefinition<TArgs>) => ({\n description: definition.description,\n execute: (args: JsonObject, context: OpencodeToolContext) => definition.execute(args as TArgs, context),\n });\n\n const tool = Object.assign(createTool, {\n schema: {\n string: createSchemaValue,\n boolean: createSchemaValue,\n },\n });\n\n return tool;\n};\n\nconst runtimeCache = new Map<string, Promise<RuntimeEntry>>();\n\nconst directorySchema: PiParamSchema = {\n type: 'object',\n properties: {\n directory: {\n type: 'string',\n description: 'Optional absolute or relative directory override for workspace-scoped wizard resolution.',\n },\n },\n};\n\nconst catalogSchema: PiParamSchema = {\n type: 'object',\n properties: {\n artifactKind: {\n type: 'string',\n description: 'Wizard artifact kind to catalog: SKILL or DESIGN_DOC; defaults to SKILL.',\n },\n directory: directorySchema.properties.directory,\n refresh: {\n type: 'boolean',\n description: 'Bypass the local plugin cache for this request.',\n },\n recommendationContext: {\n type: 'string',\n description: 'Optional metadata-only relevance/ranking context for catalog recommendations.',\n },\n },\n};\n\nconst artifactFetchSchema: PiParamSchema = {\n type: 'object',\n properties: {\n artifactKind: catalogSchema.properties.artifactKind,\n artifact: {\n type: 'string',\n description: 'Single artifact identifier; for SKILL this is a skill slug, artifact name, or skill name.',\n },\n artifacts: {\n type: 'string',\n description: 'One or more comma-separated or newline-separated artifact identifiers.',\n },\n directory: directorySchema.properties.directory,\n refresh: catalogSchema.properties.refresh,\n recommendationContext: catalogSchema.properties.recommendationContext,\n },\n};\n\nconst artifactPreferenceSchema: PiParamSchema = {\n type: 'object',\n properties: {\n artifactKind: catalogSchema.properties.artifactKind,\n artifact: {\n type: 'string',\n description: 'Artifact identifier; for SKILL this is the published skill slug.',\n },\n action: {\n type: 'string',\n description: 'Preference action: install, uninstall, ignore, or unignore.',\n },\n preferenceScope: {\n type: 'string',\n description: 'Preference scope: project/workspace or global; defaults to project.',\n },\n directory: directorySchema.properties.directory,\n },\n required: ['artifact', 'action'],\n};\n\nconst publishedSkillsFetchSchema: PiParamSchema = {\n type: 'object',\n properties: {\n skill: {\n type: 'string',\n description: 'Single skill slug, artifact name, or skill name; comma-separated values are accepted.',\n },\n skills: {\n type: 'string',\n description: 'One or more comma-separated or newline-separated skill slugs, artifact names, or skill names.',\n },\n directory: directorySchema.properties.directory,\n refresh: catalogSchema.properties.refresh,\n recommendationContext: catalogSchema.properties.recommendationContext,\n },\n};\n\nconst publishedSkillPreferenceSchema: PiParamSchema = {\n type: 'object',\n properties: {\n skill: {\n type: 'string',\n description: 'Published skill slug, artifact name, or skill name to update.',\n },\n action: artifactPreferenceSchema.properties.action,\n preferenceScope: artifactPreferenceSchema.properties.preferenceScope,\n directory: directorySchema.properties.directory,\n },\n required: ['skill', 'action'],\n};\n\nconst piToOpencodeToolNames = {\n wizard_status: 'opencode_wizard_status',\n wizard_catalog_fetch: 'opencode_wizard_catalog_fetch',\n wizard_artifact_fetch: 'opencode_wizard_artifact_fetch',\n wizard_artifact_preference_set: 'opencode_wizard_artifact_preference_set',\n wizard_published_skills_fetch: 'opencode_wizard_published_skills_fetch',\n wizard_published_skill_preference_set: 'opencode_wizard_published_skill_preference_set',\n} as const;\n\nconst opencodeToPiToolNames = Object.fromEntries(\n Object.entries(piToOpencodeToolNames).map(([piName, opencodeName]) => [opencodeName, piName]),\n) as Record<(typeof piToOpencodeToolNames)[keyof typeof piToOpencodeToolNames], keyof typeof piToOpencodeToolNames>;\n\nconst textResult = (text: string, details: JsonObject = {}): PiToolResult => ({\n content: [{ type: 'text', text }],\n details,\n});\n\nconst getStringParam = (params: unknown, key: string): string | undefined => {\n if (!params || typeof params !== 'object') return undefined;\n const value = (params as JsonObject)[key];\n if (typeof value !== 'string') return undefined;\n const trimmed = value.trim();\n if (!trimmed) return undefined;\n return trimmed;\n};\n\nconst toJsonObject = (value: unknown): JsonObject => {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return {};\n return value as JsonObject;\n};\n\nconst isExecutableTool = (value: unknown): value is OpencodeExecutableTool => {\n if (!value || typeof value !== 'object') return false;\n const candidate = value as { description?: unknown; execute?: unknown };\n return typeof candidate.description === 'string' && typeof candidate.execute === 'function';\n};\n\nconst getRuntime = (directory: string): Promise<RuntimeEntry> => {\n const key = directory;\n const existingRuntime = runtimeCache.get(key);\n if (existingRuntime) return existingRuntime;\n\n const runtime = createWizardRuntime({ worktree: directory, directory }, createPiRuntimeToolFactory());\n runtimeCache.set(key, runtime);\n return runtime;\n};\n\nconst toToolContext = (directory: string, toolCallId: string): OpencodeToolContext => ({\n sessionID: `pi-${process.pid}`,\n messageID: toolCallId,\n agent: 'pi',\n directory,\n worktree: directory,\n abort: AbortSignal.timeout(30_000),\n metadata: () => undefined,\n});\n\nconst toPiResult = (toolName: string, result: unknown): PiToolResult => {\n if (typeof result === 'string') return textResult(result, { toolName, source: PLUGIN_ID });\n if (result && typeof result === 'object' && 'output' in result) {\n const outputResult = result as Exclude<OpencodeToolResult, string>;\n return textResult(outputResult.output, { ...(outputResult.metadata ?? {}), toolName, source: PLUGIN_ID });\n }\n return textResult(JSON.stringify(result ?? null), { toolName, source: PLUGIN_ID });\n};\n\nconst toErrorMessage = (error: unknown): string => {\n if (error instanceof Error) return error.message;\n if (typeof error === 'string') return error;\n return 'Unknown Wizard Pi runtime failure.';\n};\n\nconst executeOpencodeTool = async ({\n opencodeToolName,\n toolCallId,\n params,\n}: {\n opencodeToolName: string;\n toolCallId: string;\n params: unknown;\n}): Promise<PiToolResult> => {\n try {\n const args = toJsonObject(params);\n const directory = getStringParam(args, 'directory') ?? process.cwd();\n const runtime = await getRuntime(directory);\n const tool = runtime.tool[opencodeToolName];\n\n if (!isExecutableTool(tool)) {\n return textResult(`Wizard Pi tool bridge could not find executable backend tool ${opencodeToolName}.`, {\n status: 'tool_unavailable',\n opencodeToolName,\n source: PLUGIN_ID,\n });\n }\n\n const result = await tool.execute(args, toToolContext(directory, toolCallId));\n return toPiResult(opencodeToolName, result);\n } catch (error) {\n return textResult(`Wizard Pi backend-backed tool request failed: ${toErrorMessage(error)}`, {\n status: 'request_failed',\n opencodeToolName,\n source: PLUGIN_ID,\n });\n }\n};\n\nconst createBridgeTool = ({\n name,\n label,\n description,\n promptSnippet,\n promptGuidelines,\n parameters,\n}: {\n name: keyof typeof piToOpencodeToolNames;\n label: string;\n description: string;\n promptSnippet: string;\n promptGuidelines?: string[];\n parameters: PiParamSchema;\n}): PiToolDefinition => ({\n name,\n label,\n description,\n promptSnippet,\n promptGuidelines,\n parameters,\n execute: (toolCallId, params) => executeOpencodeTool({ opencodeToolName: piToOpencodeToolNames[name], toolCallId, params }),\n});\n\nexport const buildPiTools = (): PiToolDefinition[] => [\n createBridgeTool({\n name: 'wizard_status',\n label: 'Wizard Status',\n description:\n 'Report Wizard backend auth, catalog, cache, source, and workspace-resolution status through the Pi Wizard runtime.',\n promptSnippet: 'Inspect real Wizard backend/auth/catalog status before relying on wizard-listed artifacts.',\n promptGuidelines: [\n 'Use wizard_status when you need to verify Wizard Pi backend/auth/catalog state before relying on fetched artifacts.',\n 'Missing auth, forbidden role, backend, or catalog problems are operational states reported by the backend-backed runtime.',\n ],\n parameters: directorySchema,\n }),\n createBridgeTool({\n name: 'wizard_catalog_fetch',\n label: 'Wizard Catalog Fetch',\n description:\n 'Fetch real backend wizard artifact catalog metadata for SKILL or DESIGN_DOC artifacts; metadata is discovery-only until a body is fetched.',\n promptSnippet: 'List backend wizard artifacts for this workspace/directory; fetch bodies before using artifact instructions.',\n promptGuidelines: ['Treat catalog metadata as discovery-only; call wizard_artifact_fetch or wizard_published_skills_fetch for authoritative bodies.'],\n parameters: catalogSchema,\n }),\n createBridgeTool({\n name: 'wizard_artifact_fetch',\n label: 'Wizard Artifact Fetch',\n description:\n 'Fetch real backend-authorized wizard artifact detail/body for SKILL or DESIGN_DOC artifacts through the Pi Wizard runtime.',\n promptSnippet: 'Fetch a backend wizard artifact body/detail before treating it as authoritative.',\n parameters: artifactFetchSchema,\n }),\n createBridgeTool({\n name: 'wizard_artifact_preference_set',\n label: 'Wizard Artifact Preference Set',\n description:\n 'Install, uninstall, ignore, or unignore a backend wizard artifact through the Pi Wizard preference runtime.',\n promptSnippet: 'Set backend wizard artifact preference through the real wizard runtime.',\n parameters: artifactPreferenceSchema,\n }),\n createBridgeTool({\n name: 'wizard_published_skills_fetch',\n label: 'Wizard Published Skills Fetch',\n description:\n 'Compatibility Pi tool to fetch one or more backend-published SKILL.md bodies/details through the Pi Wizard runtime.',\n promptSnippet: 'Fetch backend-published skill bodies before using wizard-listed skill guidance.',\n promptGuidelines: ['Only rely on Wizard skill instructions when this tool returns an explicit backend-fetched body/detail.'],\n parameters: publishedSkillsFetchSchema,\n }),\n createBridgeTool({\n name: 'wizard_published_skill_preference_set',\n label: 'Wizard Published Skill Preference Set',\n description:\n 'Compatibility Pi tool to install, uninstall, ignore, or unignore a backend-published skill through the Pi Wizard runtime.',\n promptSnippet: 'Set backend-published Wizard skill preference through the real wizard runtime.',\n parameters: publishedSkillPreferenceSchema,\n }),\n];\n\nconst appendSystemNotes = (systemPrompt: string, notes: string[]): string => {\n const normalizedNotes = notes.map((note) => note.trim()).filter(Boolean);\n if (normalizedNotes.length === 0) return systemPrompt;\n const missingNotes = normalizedNotes.filter((note) => !systemPrompt.includes(note));\n if (missingNotes.length === 0) return systemPrompt;\n return `${systemPrompt.trimEnd()}\\n\\n${missingNotes.join('\\n\\n')}`;\n};\n\nconst toPiSystemNote = (note: string): string => {\n let piNote = note;\n for (const [opencodeName, piName] of Object.entries(opencodeToPiToolNames)) {\n piNote = piNote.replaceAll(opencodeName, piName);\n }\n return piNote;\n};\n\nconst buildSystemPrompt = async (event: BeforeAgentStartEvent): Promise<{ systemPrompt: string }> => {\n try {\n const directory = process.cwd();\n const runtime = await getRuntime(directory);\n const output = { system: [] as string[] };\n await runtime['experimental.chat.system.transform']({}, output);\n return { systemPrompt: appendSystemNotes(event.systemPrompt, output.system.map(toPiSystemNote)) };\n } catch (error) {\n const failureNote = [\n 'Wizard Pi context:',\n 'status=request_failed',\n `source=${PLUGIN_ID}`,\n `message=${toErrorMessage(error)}`,\n ].join(' ');\n return { systemPrompt: appendSystemNotes(event.systemPrompt, [failureNote]) };\n }\n};\n\nexport default async function opencodeWizardPiExtension(pi: PiExtensionApi): Promise<void> {\n for (const tool of buildPiTools()) {\n pi.registerTool(tool);\n }\n\n pi.on('before_agent_start', buildSystemPrompt);\n}\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,SAAS,QAAQ,qBAAqB;AAgEpE,MAAMC,iBAAiB,GAAGA,CAAA,MAAoB;EAC5CC,QAAQ,EAAED,iBAAiB;EAC3BE,QAAQ,EAAEF;AACZ,CAAC,CAAC;AAEF,MAAMG,0BAA0B,GAAGA,CAAA,KAAmB;EACpD,MAAMC,UAAU,GAA0BC,UAAiC,KAAM;IAC/EC,WAAW,EAAED,UAAU,CAACC,WAAW;IACnCC,OAAO,EAAEA,CAACC,IAAgB,EAAEC,OAA4B,KAAKJ,UAAU,CAACE,OAAO,CAACC,IAAI,EAAWC,OAAO;EACxG,CAAC,CAAC;EAEF,MAAMC,IAAI,GAAGC,MAAM,CAAC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AE;IAC1E2E,MAAM,GAAGA,MAAM,CAACC,UAAU,CAACvE,YAAY,EAAED,MAAM,CAAC;EAClD;EACA,OAAOuE,MAAM;AACf,CAAC;AAED,MAAME,iBAAiB,GAAG,MAAOC,KAA4B,IAAwC;EACnG,IAAI;IACF,MAAMrG,SAAS,GAAGsD,OAAO,CAACsB,GAAG,CAAC,CAAC;IAC/B,MAAM5B,OAAO,GAAG,MAAMH,UAAU,CAAC7C,SAAS,CAAC;IAC3C,MAAMmE,MAAM,GAAG;MAAEmC,MAAM,EAAE;IAAe,CAAC;IACzC,MAAMtD,OAAO,CAAC,oCAAoC,CAAC,CAAC,CAAC,CAAC,EAAEmB,MAAM,CAAC;IAC/D,OAAO;MAAEmB,YAAY,EAAED,iBAAiB,CAACgB,KAAK,CAACf,YAAY,EAAEnB,MAAM,CAACmC,MAAM,CAAC5E,GAAG,CAACuE,cAAc,CAAC;IAAE,CAAC;EACnG,CAAC,CAAC,OAAO1B,KAAK,EAAE;IACd,MAAMgC,WAAW,GAAG,CAClB,oBAAoB,EACpB,uBAAuB,EACvB,UAAU7H,SAAS,EAAE,EACrB,WAAW4F,cAAc,CAACC,KAAK,CAAC,EAAE,CACnC,CAACyB,IAAI,CAAC,GAAG,CAAC;IACX,OAAO;MAAEV,YAAY,EAAED,iBAAiB,CAACgB,KAAK,CAACf,YAAY,EAAE,CAACiB,WAAW,CAAC;IAAE,CAAC;EAC/E;AACF,CAAC;AAED,eAAe,eAAeC,yBAAyBA,CAACC,EAAkB,EAAiB;EACzF,KAAK,MAAMpH,IAAI,IAAI+F,YAAY,CAAC,CAAC,EAAE;IACjCqB,EAAE,CAACC,YAAY,CAACrH,IAAI,CAAC;EACvB;EAEAoH,EAAE,CAACE,EAAE,CAAC,oBAAoB,EAAEP,iBAAiB,CAAC;AAChD","ignoreList":[]}
1
+ {"version":3,"names":["createWizardRuntime","PLUGIN_ID","createSchemaValue","optional","describe","createPiRuntimeToolFactory","createTool","definition","description","execute","args","context","tool","Object","assign","schema","string","boolean","runtimeCache","Map","directorySchema","type","properties","directory","catalogSchema","artifactKind","refresh","recommendationContext","artifactFetchSchema","artifact","artifacts","artifactPreferenceSchema","action","preferenceScope","required","publishedSkillsFetchSchema","skill","skills","publishedSkillPreferenceSchema","piToOpencodeToolNames","wizard_status","wizard_catalog_fetch","wizard_artifact_fetch","wizard_artifact_preference_set","wizard_published_skills_fetch","wizard_published_skill_preference_set","opencodeToPiToolNames","fromEntries","entries","map","piName","opencodeName","textResult","text","details","content","getStringParam","params","key","undefined","value","trimmed","trim","toJsonObject","Array","isArray","isExecutableTool","candidate","getRuntime","existingRuntime","get","runtime","worktree","eventSource","set","toToolContext","toolCallId","sessionID","process","pid","messageID","agent","abort","AbortSignal","timeout","metadata","toPiResult","toolName","result","source","outputResult","output","JSON","stringify","toErrorMessage","error","Error","message","executeOpencodeTool","opencodeToolName","cwd","status","createBridgeTool","name","label","promptSnippet","promptGuidelines","parameters","buildPiTools","appendSystemNotes","systemPrompt","notes","normalizedNotes","note","filter","Boolean","length","missingNotes","includes","trimEnd","join","toPiSystemNote","piNote","replaceAll","buildSystemPrompt","event","system","failureNote","opencodeWizardPiExtension","pi","registerTool","on"],"sources":["../src/server-pi.ts"],"sourcesContent":["import { createWizardRuntime, PLUGIN_ID } from './server/runtime.js';\nimport type { ToolDefinition, ToolFactory } from './plugin-tools.js';\n\ntype JsonObject = Record<string, unknown>;\n\ntype PiToolResult = {\n content: Array<{ type: 'text'; text: string }>;\n details: JsonObject;\n};\n\ntype PiParamSchema = {\n type: 'object';\n properties: Record<string, unknown>;\n required?: string[];\n};\n\ntype PiToolDefinition = {\n name: string;\n label: string;\n description: string;\n promptSnippet?: string;\n promptGuidelines?: string[];\n parameters: PiParamSchema;\n execute: (toolCallId: string, params: unknown) => Promise<PiToolResult>;\n};\n\ntype BeforeAgentStartEvent = {\n systemPrompt: string;\n};\n\ntype PiExtensionApi = {\n registerTool: (tool: PiToolDefinition) => void;\n on: (event: 'before_agent_start', handler: (event: BeforeAgentStartEvent) => Promise<{ systemPrompt: string }>) => void;\n};\n\ntype OpencodeToolResult =\n | string\n | {\n output: string;\n metadata?: JsonObject;\n };\n\ntype OpencodeToolContext = {\n sessionID: string;\n messageID: string;\n agent: string;\n directory: string;\n worktree: string;\n abort: AbortSignal;\n metadata: (input: { title?: string; metadata?: JsonObject }) => void;\n};\n\ntype OpencodeExecutableTool = {\n description: string;\n execute: (args: JsonObject, context: OpencodeToolContext) => Promise<unknown>;\n};\n\ntype RuntimeEntry = Awaited<ReturnType<typeof createWizardRuntime>>;\n\ntype SchemaValue = {\n optional: () => SchemaValue;\n describe: (description: string) => SchemaValue;\n};\n\nconst createSchemaValue = (): SchemaValue => ({\n optional: createSchemaValue,\n describe: createSchemaValue,\n});\n\nconst createPiRuntimeToolFactory = (): ToolFactory => {\n const createTool = <TArgs extends object>(definition: ToolDefinition<TArgs>) => ({\n description: definition.description,\n execute: (args: JsonObject, context: OpencodeToolContext) => definition.execute(args as TArgs, context),\n });\n\n const tool = Object.assign(createTool, {\n schema: {\n string: createSchemaValue,\n boolean: createSchemaValue,\n },\n });\n\n return tool;\n};\n\nconst runtimeCache = new Map<string, Promise<RuntimeEntry>>();\n\nconst directorySchema: PiParamSchema = {\n type: 'object',\n properties: {\n directory: {\n type: 'string',\n description: 'Optional absolute or relative directory override for workspace-scoped wizard resolution.',\n },\n },\n};\n\nconst catalogSchema: PiParamSchema = {\n type: 'object',\n properties: {\n artifactKind: {\n type: 'string',\n description: 'Wizard artifact kind to catalog: SKILL or DESIGN_DOC; defaults to SKILL.',\n },\n directory: directorySchema.properties.directory,\n refresh: {\n type: 'boolean',\n description: 'Bypass the local plugin cache for this request.',\n },\n recommendationContext: {\n type: 'string',\n description: 'Optional metadata-only relevance/ranking context for catalog recommendations.',\n },\n },\n};\n\nconst artifactFetchSchema: PiParamSchema = {\n type: 'object',\n properties: {\n artifactKind: catalogSchema.properties.artifactKind,\n artifact: {\n type: 'string',\n description: 'Single artifact identifier; for SKILL this is a skill slug, artifact name, or skill name.',\n },\n artifacts: {\n type: 'string',\n description: 'One or more comma-separated or newline-separated artifact identifiers.',\n },\n directory: directorySchema.properties.directory,\n refresh: catalogSchema.properties.refresh,\n recommendationContext: catalogSchema.properties.recommendationContext,\n },\n};\n\nconst artifactPreferenceSchema: PiParamSchema = {\n type: 'object',\n properties: {\n artifactKind: catalogSchema.properties.artifactKind,\n artifact: {\n type: 'string',\n description: 'Artifact identifier; for SKILL this is the published skill slug.',\n },\n action: {\n type: 'string',\n description: 'Preference action: install, uninstall, ignore, or unignore.',\n },\n preferenceScope: {\n type: 'string',\n description: 'Preference scope: project/workspace or global; defaults to project.',\n },\n directory: directorySchema.properties.directory,\n },\n required: ['artifact', 'action'],\n};\n\nconst publishedSkillsFetchSchema: PiParamSchema = {\n type: 'object',\n properties: {\n skill: {\n type: 'string',\n description: 'Single skill slug, artifact name, or skill name; comma-separated values are accepted.',\n },\n skills: {\n type: 'string',\n description: 'One or more comma-separated or newline-separated skill slugs, artifact names, or skill names.',\n },\n directory: directorySchema.properties.directory,\n refresh: catalogSchema.properties.refresh,\n recommendationContext: catalogSchema.properties.recommendationContext,\n },\n};\n\nconst publishedSkillPreferenceSchema: PiParamSchema = {\n type: 'object',\n properties: {\n skill: {\n type: 'string',\n description: 'Published skill slug, artifact name, or skill name to update.',\n },\n action: artifactPreferenceSchema.properties.action,\n preferenceScope: artifactPreferenceSchema.properties.preferenceScope,\n directory: directorySchema.properties.directory,\n },\n required: ['skill', 'action'],\n};\n\nconst piToOpencodeToolNames = {\n wizard_status: 'opencode_wizard_status',\n wizard_catalog_fetch: 'opencode_wizard_catalog_fetch',\n wizard_artifact_fetch: 'opencode_wizard_artifact_fetch',\n wizard_artifact_preference_set: 'opencode_wizard_artifact_preference_set',\n wizard_published_skills_fetch: 'opencode_wizard_published_skills_fetch',\n wizard_published_skill_preference_set: 'opencode_wizard_published_skill_preference_set',\n} as const;\n\nconst opencodeToPiToolNames = Object.fromEntries(\n Object.entries(piToOpencodeToolNames).map(([piName, opencodeName]) => [opencodeName, piName]),\n) as Record<(typeof piToOpencodeToolNames)[keyof typeof piToOpencodeToolNames], keyof typeof piToOpencodeToolNames>;\n\nconst textResult = (text: string, details: JsonObject = {}): PiToolResult => ({\n content: [{ type: 'text', text }],\n details,\n});\n\nconst getStringParam = (params: unknown, key: string): string | undefined => {\n if (!params || typeof params !== 'object') return undefined;\n const value = (params as JsonObject)[key];\n if (typeof value !== 'string') return undefined;\n const trimmed = value.trim();\n if (!trimmed) return undefined;\n return trimmed;\n};\n\nconst toJsonObject = (value: unknown): JsonObject => {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return {};\n return value as JsonObject;\n};\n\nconst isExecutableTool = (value: unknown): value is OpencodeExecutableTool => {\n if (!value || typeof value !== 'object') return false;\n const candidate = value as { description?: unknown; execute?: unknown };\n return typeof candidate.description === 'string' && typeof candidate.execute === 'function';\n};\n\nconst getRuntime = (directory: string): Promise<RuntimeEntry> => {\n const key = directory;\n const existingRuntime = runtimeCache.get(key);\n if (existingRuntime) return existingRuntime;\n\n const runtime = createWizardRuntime({ worktree: directory, directory }, createPiRuntimeToolFactory(), { eventSource: 'PI' });\n runtimeCache.set(key, runtime);\n return runtime;\n};\n\nconst toToolContext = (directory: string, toolCallId: string): OpencodeToolContext => ({\n sessionID: `pi-${process.pid}`,\n messageID: toolCallId,\n agent: 'pi',\n directory,\n worktree: directory,\n abort: AbortSignal.timeout(30_000),\n metadata: () => undefined,\n});\n\nconst toPiResult = (toolName: string, result: unknown): PiToolResult => {\n if (typeof result === 'string') return textResult(result, { toolName, source: PLUGIN_ID });\n if (result && typeof result === 'object' && 'output' in result) {\n const outputResult = result as Exclude<OpencodeToolResult, string>;\n return textResult(outputResult.output, { ...(outputResult.metadata ?? {}), toolName, source: PLUGIN_ID });\n }\n return textResult(JSON.stringify(result ?? null), { toolName, source: PLUGIN_ID });\n};\n\nconst toErrorMessage = (error: unknown): string => {\n if (error instanceof Error) return error.message;\n if (typeof error === 'string') return error;\n return 'Unknown Wizard Pi runtime failure.';\n};\n\nconst executeOpencodeTool = async ({\n opencodeToolName,\n toolCallId,\n params,\n}: {\n opencodeToolName: string;\n toolCallId: string;\n params: unknown;\n}): Promise<PiToolResult> => {\n try {\n const args = toJsonObject(params);\n const directory = getStringParam(args, 'directory') ?? process.cwd();\n const runtime = await getRuntime(directory);\n const tool = runtime.tool[opencodeToolName];\n\n if (!isExecutableTool(tool)) {\n return textResult(`Wizard Pi tool bridge could not find executable backend tool ${opencodeToolName}.`, {\n status: 'tool_unavailable',\n opencodeToolName,\n source: PLUGIN_ID,\n });\n }\n\n const result = await tool.execute(args, toToolContext(directory, toolCallId));\n return toPiResult(opencodeToolName, result);\n } catch (error) {\n return textResult(`Wizard Pi backend-backed tool request failed: ${toErrorMessage(error)}`, {\n status: 'request_failed',\n opencodeToolName,\n source: PLUGIN_ID,\n });\n }\n};\n\nconst createBridgeTool = ({\n name,\n label,\n description,\n promptSnippet,\n promptGuidelines,\n parameters,\n}: {\n name: keyof typeof piToOpencodeToolNames;\n label: string;\n description: string;\n promptSnippet: string;\n promptGuidelines?: string[];\n parameters: PiParamSchema;\n}): PiToolDefinition => ({\n name,\n label,\n description,\n promptSnippet,\n promptGuidelines,\n parameters,\n execute: (toolCallId, params) => executeOpencodeTool({ opencodeToolName: piToOpencodeToolNames[name], toolCallId, params }),\n});\n\nexport const buildPiTools = (): PiToolDefinition[] => [\n createBridgeTool({\n name: 'wizard_status',\n label: 'Wizard Status',\n description:\n 'Report Wizard backend auth, catalog, cache, source, and workspace-resolution status through the Pi Wizard runtime.',\n promptSnippet: 'Inspect real Wizard backend/auth/catalog status before relying on wizard-listed artifacts.',\n promptGuidelines: [\n 'Use wizard_status when you need to verify Wizard Pi backend/auth/catalog state before relying on fetched artifacts.',\n 'Missing auth, forbidden role, backend, or catalog problems are operational states reported by the backend-backed runtime.',\n ],\n parameters: directorySchema,\n }),\n createBridgeTool({\n name: 'wizard_catalog_fetch',\n label: 'Wizard Catalog Fetch',\n description:\n 'Fetch real backend wizard artifact catalog metadata for SKILL or DESIGN_DOC artifacts; metadata is discovery-only until a body is fetched.',\n promptSnippet: 'List backend wizard artifacts for this workspace/directory; fetch bodies before using artifact instructions.',\n promptGuidelines: ['Treat catalog metadata as discovery-only; call wizard_artifact_fetch or wizard_published_skills_fetch for authoritative bodies.'],\n parameters: catalogSchema,\n }),\n createBridgeTool({\n name: 'wizard_artifact_fetch',\n label: 'Wizard Artifact Fetch',\n description:\n 'Fetch real backend-authorized wizard artifact detail/body for SKILL or DESIGN_DOC artifacts through the Pi Wizard runtime.',\n promptSnippet: 'Fetch a backend wizard artifact body/detail before treating it as authoritative.',\n parameters: artifactFetchSchema,\n }),\n createBridgeTool({\n name: 'wizard_artifact_preference_set',\n label: 'Wizard Artifact Preference Set',\n description:\n 'Install, uninstall, ignore, or unignore a backend wizard artifact through the Pi Wizard preference runtime.',\n promptSnippet: 'Set backend wizard artifact preference through the real wizard runtime.',\n parameters: artifactPreferenceSchema,\n }),\n createBridgeTool({\n name: 'wizard_published_skills_fetch',\n label: 'Wizard Published Skills Fetch',\n description:\n 'Compatibility Pi tool to fetch one or more backend-published SKILL.md bodies/details through the Pi Wizard runtime.',\n promptSnippet: 'Fetch backend-published skill bodies before using wizard-listed skill guidance.',\n promptGuidelines: ['Only rely on Wizard skill instructions when this tool returns an explicit backend-fetched body/detail.'],\n parameters: publishedSkillsFetchSchema,\n }),\n createBridgeTool({\n name: 'wizard_published_skill_preference_set',\n label: 'Wizard Published Skill Preference Set',\n description:\n 'Compatibility Pi tool to install, uninstall, ignore, or unignore a backend-published skill through the Pi Wizard runtime.',\n promptSnippet: 'Set backend-published Wizard skill preference through the real wizard runtime.',\n parameters: publishedSkillPreferenceSchema,\n }),\n];\n\nconst appendSystemNotes = (systemPrompt: string, notes: string[]): string => {\n const normalizedNotes = notes.map((note) => note.trim()).filter(Boolean);\n if (normalizedNotes.length === 0) return systemPrompt;\n const missingNotes = normalizedNotes.filter((note) => !systemPrompt.includes(note));\n if (missingNotes.length === 0) return systemPrompt;\n return `${systemPrompt.trimEnd()}\\n\\n${missingNotes.join('\\n\\n')}`;\n};\n\nconst toPiSystemNote = (note: string): string => {\n let piNote = note;\n for (const [opencodeName, piName] of Object.entries(opencodeToPiToolNames)) {\n piNote = piNote.replaceAll(opencodeName, piName);\n }\n return piNote;\n};\n\nconst buildSystemPrompt = async (event: BeforeAgentStartEvent): Promise<{ systemPrompt: string }> => {\n try {\n const directory = process.cwd();\n const runtime = await getRuntime(directory);\n const output = { system: [] as string[] };\n await runtime['experimental.chat.system.transform']({}, output);\n return { systemPrompt: appendSystemNotes(event.systemPrompt, output.system.map(toPiSystemNote)) };\n } catch (error) {\n const failureNote = [\n 'Wizard Pi context:',\n 'status=request_failed',\n `source=${PLUGIN_ID}`,\n `message=${toErrorMessage(error)}`,\n ].join(' ');\n return { systemPrompt: appendSystemNotes(event.systemPrompt, [failureNote]) };\n }\n};\n\nexport default async function opencodeWizardPiExtension(pi: PiExtensionApi): Promise<void> {\n for (const tool of buildPiTools()) {\n pi.registerTool(tool);\n }\n\n pi.on('before_agent_start', buildSystemPrompt);\n}\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,SAAS,QAAQ,qBAAqB;AAgEpE,MAAMC,iBAAiB,GAAGA,CAAA,MAAoB;EAC5CC,QAAQ,EAAED,iBAAiB;EAC3BE,QAAQ,EAAEF;AACZ,CAAC,CAAC;AAEF,MAAMG,0BAA0B,GAAGA,CAAA,KAAmB;EACpD,MAAMC,UAAU,GAA0BC,UAAiC,KAAM;IAC/EC,WAAW,EAAED,UAAU,CAACC,WAAW;IACnCC,OAAO,EAAEA,CAACC,IAAgB,EAAEC,OAA4B,KAAKJ,UAAU,CAACE,OAAO,CAACC,IAAI,EAAWC,OAAO;EACxG,CAAC,CAAC;EAEF,MAAMC,IAAI,GAAGC,MAAM,CAACC,MAAM,CAACR,UAAU,EAAE;IACrCS,MAAM,EAAE;MACNC,MAAM,EAAEd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AM,CAACC,UAAU,CAACxE,YAAY,EAAED,MAAM,CAAC;EAClD;EACA,OAAOwE,MAAM;AACf,CAAC;AAED,MAAME,iBAAiB,GAAG,MAAOC,KAA4B,IAAwC;EACnG,IAAI;IACF,MAAMtG,SAAS,GAAGuD,OAAO,CAACsB,GAAG,CAAC,CAAC;IAC/B,MAAM7B,OAAO,GAAG,MAAMH,UAAU,CAAC7C,SAAS,CAAC;IAC3C,MAAMoE,MAAM,GAAG;MAAEmC,MAAM,EAAE;IAAe,CAAC;IACzC,MAAMvD,OAAO,CAAC,oCAAoC,CAAC,CAAC,CAAC,CAAC,EAAEoB,MAAM,CAAC;IAC/D,OAAO;MAAEmB,YAAY,EAAED,iBAAiB,CAACgB,KAAK,CAACf,YAAY,EAAEnB,MAAM,CAACmC,MAAM,CAAC7E,GAAG,CAACwE,cAAc,CAAC;IAAE,CAAC;EACnG,CAAC,CAAC,OAAO1B,KAAK,EAAE;IACd,MAAMgC,WAAW,GAAG,CAClB,oBAAoB,EACpB,uBAAuB,EACvB,UAAU9H,SAAS,EAAE,EACrB,WAAW6F,cAAc,CAACC,KAAK,CAAC,EAAE,CACnC,CAACyB,IAAI,CAAC,GAAG,CAAC;IACX,OAAO;MAAEV,YAAY,EAAED,iBAAiB,CAACgB,KAAK,CAACf,YAAY,EAAE,CAACiB,WAAW,CAAC;IAAE,CAAC;EAC/E;AACF,CAAC;AAED,eAAe,eAAeC,yBAAyBA,CAACC,EAAkB,EAAiB;EACzF,KAAK,MAAMrH,IAAI,IAAIgG,YAAY,CAAC,CAAC,EAAE;IACjCqB,EAAE,CAACC,YAAY,CAACtH,IAAI,CAAC;EACvB;EAEAqH,EAAE,CAACE,EAAE,CAAC,oBAAoB,EAAEP,iBAAiB,CAAC;AAChD","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexol/opencode-wizard",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "OpenCode plugin for opencode-wizard published skills",
5
5
  "type": "module",
6
6
  "oc-plugin": [