Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tsconfig.json
scripts/**
jetbrains/**
.gitmodules
RELEASING.md
RELEASING*.md
DEVELOPMENT.md
DEVELOPMENT.en.md
# 仓库自身的忽略规则对运行时毫无用处,打进 VSIX 只是噪音
Expand All @@ -33,7 +33,6 @@ logs/**/*.log
.vscode/tasks.json
.vscode/launch.json
.vscode/ok-lang-hints-*.json
AGENT.md
AGENTS.md
**/agent.md
**/agents.md
Expand All @@ -47,7 +46,7 @@ python/test_*.py
**/*.bak
**/*.ok-script-toolkit.tmp
# 审查/修复计划类的一次性工作目录(verification-<日期> at <时间>/ 等)。
# 这些是开发过程产物,按 AGENT.md 的打包红线不得进产物。用通配而不是逐个列名 ——
# 这些是开发过程产物,按 AGENTS.md 的打包红线不得进产物。用通配而不是逐个列名 ——
# 每次审查都会新建一个带时间戳的目录,逐个列名必然漏(2026-09-20 实测漏了 107 KB)。
verification-*/
verification */*
67 changes: 0 additions & 67 deletions AGENT.md

This file was deleted.

70 changes: 65 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,66 @@
# 仓库协作指引
# 仓库协作指引与开发规范

- 开发与打包约束见 [AGENT.md](AGENT.md)。
- 处理主仓或 `jetbrains/` 子仓的 PR review 时,先读
[.agents/skills/ok-script-pr-review/SKILL.md](.agents/skills/ok-script-pr-review/SKILL.md)。
两边是独立 Git 仓库,调用 GitHub API 时须明确仓库。
## PR review

处理主仓或 `jetbrains/` 子仓的 PR review 时,先读
[.agents/skills/ok-script-pr-review/SKILL.md](.agents/skills/ok-script-pr-review/SKILL.md)。
两边是独立 Git 仓库,调用 GitHub API 时须明确仓库。

等待 PR review 时使用技能提供的长时间等待脚本,复用已有终端进程,并让用户能在 Codex 侧边查看输出。不要默认改成隐藏进程,也不要为等待另外创建定时任务、heartbeat 或轮询 automation,除非用户明确要求。

## 仓库定位与功能边界

本仓库是面向 **ok-script 项目开发者的 IDE 插件**,用于开发、调试和资源制作。功能取舍以缩短开发步骤、准确操作当前本地代码、方便定位问题为目标。

**需要承担:**

* 准确识别本地工作区当前的项目、解释器、任务注册、参数声明和资源入口;核对功能时以本地代码为准,历史版本与远程提交仅作参考。
* 支持任务运行、触发任务启用、暂停、停止和当前参数试验,尽量沿用项目与框架的真实启动方式。
* 隔离调试配置与项目实际配置,明确覆盖范围;用户主动编辑模板、框、角色等项目资源时,按该操作的既有保存语义写入。
* 提供真实的保存结果、可确认的运行状态、日志与错误入口。项目路径、执行器、任务标识、配置来源等技术信息应清楚可达。
* 支持截图、标注、模板与区域制作、代码引用、补全、预览和来源跳转;两端保持操作含义一致,界面紧凑、清晰、易操作。
* 插件依赖的框架 API、任务元数据、配置定位或资源格式变化,导致当前功能读错、写错或不能运行时,修正插件的检测与调用入口。

**不需要承担:**

* 业务项目的参数迁移、历史值恢复、跨任务配置搬运、账号覆盖迁移或旧业务版本兼容。这些由业务项目负责;项目启动链内已有逻辑可正常执行,插件不另建一套业务迁移机制。
* 恢复业务项目已经移除、不再需要的参数。参数删除、任务拆分、参数归属调整和内部检测点更换属于正常内容改造;能正确读取当前声明时,不据此安排额外适配。
* 把旧调试快照中的键当作当前任务仍支持的参数,或凭字段同名、旧任务关系自动推断并搬运历史值。
* 默认扩展普通业务软件的账号生命周期、迁移恢复向导、完整健康看板等流程;也不为凑齐 UI 状态要求每个业务项目新增应用回执或观测协议。

插件仍负责**自己的**持久化格式、协议和缓存兼容。无法确认运行应用或等待原因时,如实说明并提供日志入口。优先保证当前调试链可靠,再改善开发效率与视觉体验。详细依据见 [开发者插件功能范围](docs/developer-tool-scope.md)。

## 协作说明文档

* 面向大模型的指令、技能和配套说明(包括 `AGENTS.md`、`SKILL.md`)每份文档只维护单文件、单语言版本,本仓库使用中文;不混写中英文正文,也不另建 `.en.md` 等翻译副本。
* 除 Agent 指令、技能及技能配套说明外,所有文档必须同时维护中文与英文版本,分别放在 `名称.md` 与 `名称.en.md` 中;每个文件只保留对应语言的正文,更新时同步两份内容与相应链接。
* 文件名、代码、API 名称和必要的原始界面文字保留原文,不视为双语正文。

## 资源外置

* **i18n 文案必须外置**,禁止在业务代码中硬编码可翻译文本。
* **任何代码内使用的 HTML 资源必须外置**,禁止将 HTML 模板、HTML 片段直接嵌入 Python/JS/TS 等代码中。
* 外置资源应放在项目约定的资源目录中,并通过统一的资源加载机制读取。
* 新增功能时,如果涉及 i18n 或 HTML,必须同步新增对应的外部资源文件,不得为了方便直接写入代码。
* 修改现有功能时,如发现已有代码内嵌 i18n 或 HTML,应优先一并迁移到外部资源。

## 插件打包

以下属于**仅开发使用的文件**,不得进入插件最终打包产物:

* `AGENTS.md`
* 其他 `agent.md` / `agents.md` 文件
* 项目开发说明、AI Agent 指令及相关开发辅助文件
* 测试文件及其他明确标记为开发用途的资源

插件打包配置必须显式忽略上述文件,避免将开发文件随插件发布。

## 检查要求

提交代码前应检查:

1. 是否存在新增的代码内嵌 i18n 文案。
2. 是否存在新增的代码内嵌 HTML。
3. 新增的 HTML/i18n 是否已经外置到规定目录。
4. 插件打包产物中不得包含 `AGENTS.md` 等 Agent 开发文件。
5. 修改打包忽略规则后,应验证最终插件压缩包/产物中确实不存在这些文件。
16 changes: 7 additions & 9 deletions DEVELOPMENT.en.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# 开发指南 / Development Guide
# Development Guide

<div align="center">

[![简体中文](https://img.shields.io/badge/Language-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-6E7681?style=for-the-badge)](DEVELOPMENT.md) [![English](https://img.shields.io/badge/Language-English%20%E2%9C%93-2EA043?style=for-the-badge)](DEVELOPMENT.en.md)

</div>

本文档面向扩展开发者,包含项目结构、本地构建安装和发布流程。

This document is for extension developers and covers the project structure, local build/installation, and release workflow.

The shared runtime scripts, protocol, and host boundaries are documented in [Shared core](docs/shared-core.md).
The shared runtime scripts, protocol, and host boundaries are documented in [Shared core](docs/shared-core.en.md); see [feature parity](docs/feature-parity.en.md) for current capabilities and limits.

---

## Project Structure

```text
src/ VS Code extension host TypeScript source (33 modules; entry points and major ones listed)
src/ VS Code extension host TypeScript source (entry points and major modules listed, not a complete inventory)
projectConfig.ts Read side of the project convention file ok-script-toolkit.json (locate + cache + personal preference)
projectConfigPure.ts Pure precedence-chain logic (no vscode dependency, unit-testable): parse + precedence + winning layer
conventionSources.ts Data source for the "Project Convention vs My Settings" tracing panel
Expand Down Expand Up @@ -62,7 +60,7 @@ media/ Per-Webview HTML/CSS/JS (loaded by the host via CS
python/ Helper scripts shipped with the extension: task discovery, probing & execution (parse_config_tasks.py, probe_task_schemas.py, run_executor.py), plus game window capture & config probing for the template asset panel (capture_game_window.py, probe_window_config.py)
python/tests/ Development-time Python regression tests (test_probe_*.py ×5 and test_run_executor_*.py ×4,
9 in total, all wired into npm test; plus _test_tmp.py, the shared per-suite temp-dir infrastructure);
excluded from VSIX / JetBrains JAR per AGENT.md packaging rules
excluded from VSIX / JetBrains JAR per AGENTS.md packaging rules
jetbrains/ The JetBrains plugin's **separate public repository** (git submodule), with its own README / CI / release flow
schemas/ JSON Schema for ok-script-toolkit.json (editor completion and validation)
docs/ Design documents (config-reads overview, convention-file design, global UI design system, copy-pasteable example config)
Expand Down Expand Up @@ -118,7 +116,7 @@ The `jetbrains/` directory contains a standalone Kotlin + IntelliJ Platform plug
Drag **works here** — the two tool windows share the same JVM and use a custom `DataFlavor` to pass paths;
note that `JPanel` has no built-in auto-drag-out, requiring manual `exportAsDrag` in `mouseDragged`.
- Follow-up parity work from main-repo v1.9.0 → v1.13.0 (Swing-side spec at
[`jetbrains/docs/design-parity.md`](https://github.com/AliceJump/ok-script-toolkit-jetbrains/blob/main/docs/design-parity.md)):
[`jetbrains/docs/design-parity.md`](https://github.com/AliceJump/ok-script-toolkit-jetbrains/blob/main/docs/design-parity.en.md)):
**global config takeover** (probe parses global config groups → parameter snapshots persisted →
full snapshot injected via `OK_TOOLKIT_GCONFIG` at executor launch → live push via `gparams` while running),
the health bar and the idle-state **run center** (current task / execution queue / trigger polling),
Expand All @@ -131,7 +129,7 @@ cd jetbrains
./gradlew test buildPlugin verifyPluginStructure verifyPluginConfiguration
```

Use `gradlew.bat` on Windows. The generated ZIP is at `jetbrains/build/distributions/` and can be installed via **Settings / Plugins / Install Plugin from Disk...** in a JetBrains IDE. For per-feature alignment status and remaining gaps, see [`jetbrains/docs/parity-review.md`](https://github.com/AliceJump/ok-script-toolkit-jetbrains/blob/main/docs/parity-review.md) (re-verified line by line against the code on 2026-09-21, baseline v1.8.0).
Use `gradlew.bat` on Windows. The generated ZIP is at `jetbrains/build/distributions/` and can be installed via **Settings / Plugins / Install Plugin from Disk...** in a JetBrains IDE. For per-feature alignment status and remaining gaps, see [`jetbrains/docs/parity-review.md`](https://github.com/AliceJump/ok-script-toolkit-jetbrains/blob/main/docs/parity-review.en.md) (historical baseline; see [current feature parity](docs/feature-parity.en.md)).

## Installation

Expand Down Expand Up @@ -284,4 +282,4 @@ Add each one in the GitHub repo under **Settings → Secrets and variables → A

When using VS Marketplace OIDC, also add `VSCE_USE_OIDC=true` under **Actions → Variables → New repository variable**; only enable after completing Marketplace Trusted Publishing policy.

See [RELEASING.md](RELEASING.md) for full token setup, signing key generation, and step-by-step release instructions.
See [RELEASING.md](RELEASING.en.md) for full token setup, signing key generation, and step-by-step release instructions.
12 changes: 5 additions & 7 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 开发指南 / Development Guide
# 开发指南

<div align="center">

Expand All @@ -8,16 +8,14 @@

本文档面向扩展开发者,包含项目结构、本地构建安装和发布流程。

两端共同维护的运行脚本、协议和宿主边界见 [共用核心](docs/shared-core.md)。

This document is for extension developers and covers the project structure, local build/installation, and release workflow.
两端共同维护的运行脚本、协议和宿主边界见 [共用核心](docs/shared-core.md),当前功能和限制见 [功能对齐表](docs/feature-parity.md)。

---

## 项目结构

```text
src/ VS Code 扩展宿主 TypeScript 源码(33 个模块,下列为入口与主要模块)
src/ VS Code 扩展宿主 TypeScript 源码(下列为入口与主要模块,非完整清单)
projectConfig.ts 项目约定文件 ok-script-toolkit.json 的读盘侧(定位 + 缓存 + 个人偏好)
projectConfigPure.ts 取值链纯逻辑(不依赖 vscode,可单测):解析 + 优先级 + 来源层
conventionSources.ts 「项目约定 vs 我的设置」溯源面板的数据源
Expand Down Expand Up @@ -62,7 +60,7 @@ media/ 每个外置 Webview 的 HTML/CSS/JS(宿主经 C
python/ 随扩展发布的辅助脚本:任务发现、探测与执行(parse_config_tasks.py、probe_task_schemas.py、run_executor.py),以及模板素材面板的游戏窗口截图与配置探测(capture_game_window.py、probe_window_config.py)
python/tests/ 开发期 Python 回归测试(test_probe_*.py ×5、test_run_executor_*.py ×4,
共 9 个,npm test 全部接入;另有三端共用的测试临时目录基建 _test_tmp.py);
按 AGENT.md 打包规范不进 VSIX / JetBrains JAR
按 AGENTS.md 打包规范不进 VSIX / JetBrains JAR
jetbrains/ JetBrains 插件的**独立公开仓库**(git submodule),有自己的 README / CI / 发版流程
schemas/ ok-script-toolkit.json 的 JSON Schema(编辑器补全与校验)
docs/ 设计文档(配置读取全景、项目约定文件设计、全局 UI 设计规范、可直接复制的示例配置)
Expand Down Expand Up @@ -130,7 +128,7 @@ cd jetbrains
./gradlew test buildPlugin verifyPluginStructure verifyPluginConfiguration
```

Windows 使用 `gradlew.bat`。生成的 ZIP 位于 `jetbrains/build/distributions/`,可在 JetBrains IDE 的 **Settings / Plugins / Install Plugin from Disk...** 中安装。逐功能的对齐状态与剩余差异见 [`jetbrains/docs/parity-review.md`](https://github.com/AliceJump/ok-script-toolkit-jetbrains/blob/main/docs/parity-review.md)(2026-09-21 已按代码逐条重核,基线 v1.8.0)。
Windows 使用 `gradlew.bat`。生成的 ZIP 位于 `jetbrains/build/distributions/`,可在 JetBrains IDE 的 **Settings / Plugins / Install Plugin from Disk...** 中安装。逐功能的对齐状态与剩余差异见 [`jetbrains/docs/parity-review.md`](https://github.com/AliceJump/ok-script-toolkit-jetbrains/blob/main/docs/parity-review.md)(保留历史基线;当前实现见 [功能对齐表](docs/feature-parity.md))。

## 安装

Expand Down
Loading
Loading