feat: add Pi provider managed resources

This commit is contained in:
2026-08-22 21:48:00 +08:00
parent 81d8ad1b6b
commit 161f3f471b
31 changed files with 1581 additions and 40 deletions

View File

@@ -7,7 +7,7 @@ import {
unlinkSync,
} from 'node:fs';
import { join } from 'node:path';
import { BUNDLED_OPENCODE_SKILL_IDS } from '../../shared/opencode-skills';
import { BUNDLED_CODING_SKILL_IDS } from '../../shared/coding-skills';
export interface BundledSkillsPathInput {
isPackaged: boolean;
@@ -20,7 +20,7 @@ export interface EnsureBundledCourseSkillsOptions {
sourceDir?: string;
}
export const BUNDLED_COURSE_SKILL_IDS = BUNDLED_OPENCODE_SKILL_IDS;
export const BUNDLED_COURSE_SKILL_IDS = BUNDLED_CODING_SKILL_IDS;
const RETIRED_COURSE_SKILL_IDS = [
'course-stage-review',
'student-growth-logger',
@@ -48,18 +48,15 @@ const LEGACY_SUPERPOWERS_ARTIFACTS = [
export function resolveBundledCourseSkillsDir(input: BundledSkillsPathInput): string {
return input.isPackaged
? join(input.resourcesPath, 'course-skills')
: join(input.appPath, '.opencode', 'skills');
? join(input.resourcesPath, 'resources', 'coding-skills')
: join(input.appPath, 'resources', 'coding-skills');
}
export function resolveBundledAgentBrowserPluginPath(input: BundledSkillsPathInput): string {
return join(
resolveBundledCourseSkillsDir(input),
'agent-browser',
'.opencode',
'plugins',
'niancode-agent-browser.js',
);
const resourcesRoot = input.isPackaged
? join(input.resourcesPath, 'resources')
: join(input.appPath, 'resources');
return join(resourcesRoot, 'coding-extensions', 'opencode', 'niancode-agent-browser.js');
}
export function getManagedOpencodeConfigDir(userDataDir: string): string {