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
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CI

on:
push:
branches:
- develop
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test (Python 3.8)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Python 3.8
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.8"

- name: Run unit tests
run: python -m unittest discover -s tests -v

code-check:
name: Code check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Python 3.8
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.8"

- name: Check Python syntax
run: >-
python -m compileall -q
scripts
tests
plugins/codex/lihi/skills/lihi-shorten/scripts
plugins/claude/lihi/skills/lihi-shorten/scripts

- name: Check Codex and Claude parity
run: |
cmp plugins/codex/lihi/skills/lihi-shorten/scripts/detect_urls.py plugins/claude/lihi/skills/lihi-shorten/scripts/detect_urls.py
cmp plugins/codex/lihi/skills/lihi-shorten/references/shortening-workflow.md plugins/claude/lihi/skills/lihi-shorten/references/shortening-workflow.md
cmp plugins/codex/lihi/skills/lihi-switch-group/references/error-recovery.md plugins/claude/lihi/skills/lihi-switch-group/references/error-recovery.md
cmp plugins/codex/lihi/skills/lihi-switch-domain/references/error-recovery.md plugins/claude/lihi/skills/lihi-switch-domain/references/error-recovery.md

- name: Check whitespace errors
run: git diff --check "$(git hash-object -t tree /dev/null)" HEAD -- .

package:
name: Package develop bundle
if: >-
github.event_name != 'pull_request' &&
github.ref != 'refs/heads/main'
needs:
- test
- code-check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Python 3.8
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.8"

- name: Build develop bundle
run: >-
python scripts/package_develop_bundle.py
--output-dir dist
--build-number "${{ github.run_number }}"
--commit "${{ github.sha }}"

- name: Upload develop bundle
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: lihi-agent-develop-${{ github.run_number }}
path: dist/lihi-agent-*
if-no-files-found: error
include-hidden-files: true
retention-days: 14
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ This repository packages one lihi plugin for Codex and one for Claude Code. Each
| Group switch | `lihi-switch-group` | `lihi-switch-group-dev` |
| Domain switch | `lihi-switch-domain` | `lihi-switch-domain-dev` |

Production endpoint: `https://app.lihi.com/mcp/v1/tools`.
Production endpoint: `https://app.lihi.io/mcp/v1/tools`.
Develop endpoint: `https://app.lihidev.com/mcp/v1/tools`.

Checked-in runtime files must remain production-only. Develop identities and endpoints may appear in packaging code, CI, tests, and generated artifacts. The server advertises minimum plugin version `0.3.0` through `tools/list` metadata.
Checked-in runtime files must remain production-only. Develop identities and endpoints may appear in packaging code, CI, tests, and generated artifacts. The server advertises minimum plugin version `0.3.1` through `tools/list` metadata.

## Host and skill responsibilities

Expand Down Expand Up @@ -112,7 +112,7 @@ CI runs Python 3.8 unit tests, confirms parity files, builds a develop bundle, a
- retains singular `skill_name` at root and `plugins[0]` as a deprecated alias equal to `skill_names[0]` for 0.3 compatibility;
- excludes caches and preserves source runtime files unchanged.

Both manifests must share core version `0.3.0`. Codex may add one cachebuster suffix. When modifying the Codex bundle, run the plugin-creator cachebuster helper last and validate the plugin. Reinstall only when explicitly requested; after reinstall, test from a new conversation.
Both manifests must share core version `0.3.1`. Codex may add one cachebuster suffix. When modifying the Codex bundle, run the plugin-creator cachebuster helper last and validate the plugin. Reinstall only when explicitly requested; after reinstall, test from a new conversation.

Never commit `dist/`, a develop/localhost runtime URL, or a develop identity in production runtime configuration.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Use lihi account status, group and short URL domain switching, and URL shortenin
The production Streamable HTTP endpoint is:

```text
https://app.lihi.com/mcp/v1/tools
https://app.lihi.io/mcp/v1/tools
```

## Install
Expand Down
2 changes: 1 addition & 1 deletion README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
正式環境 Streamable HTTP 端點為:

```text
https://app.lihi.com/mcp/v1/tools
https://app.lihi.io/mcp/v1/tools
```

## 安裝
Expand Down
2 changes: 1 addition & 1 deletion docs/acceptance-scenarios.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ These scenarios apply to both production host bundles and their generated develo
| ID | Scenario | Expected result |
| --- | --- | --- |
| A1 | Inspect either host bundle | Exactly four skills and one shared OAuth MCP registration exist. |
| A2 | Inspect tool metadata | Six current tools are documented and minimum plugin version is 0.3.0. |
| A2 | Inspect tool metadata | Six current tools are documented and minimum plugin version is 0.3.1. |
| A3 | Build develop artifact | Four `-dev` skills, `lihi-dev` identities, and develop endpoint appear; production runtime remains unchanged. |
| A4 | Inspect requests with `Origin` | The contract does not reject solely because `Origin` is present and does not overclaim browser support. |

Expand Down
6 changes: 3 additions & 3 deletions docs/mcp-contract.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# lihi MCP client contract

This document defines the 0.3.0 agent-side contract for the production Streamable HTTP endpoint:
This document defines the 0.3.1 agent-side contract for the production Streamable HTTP endpoint:

```text
https://app.lihi.com/mcp/v1/tools
https://app.lihi.io/mcp/v1/tools
```

Codex and Claude Code own transport and OAuth. Each plugin registers one MCP server and exposes the same six tools through four skills. `tools/list` advertises `_meta["lihi/plugin"].minVersion` as `0.3.0`.
Codex and Claude Code own transport and OAuth. Each plugin registers one MCP server and exposes the same six tools through four skills. `tools/list` advertises `_meta["lihi/plugin"].minVersion` as `0.3.1`.

Requests containing an `Origin` header are not rejected solely for that header. This contract does not claim complete browser or CORS support.

Expand Down
2 changes: 1 addition & 1 deletion plugins/claude/lihi/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lihi",
"displayName": "lihi",
"version": "0.3.0",
"version": "0.3.1",
"description": "Connect Claude Code to lihi through one OAuth MCP registration for account status, group and domain switching, and automatic URL shortening.",
"author": {
"name": "lihi",
Expand Down
2 changes: 1 addition & 1 deletion plugins/claude/lihi/.mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mcpServers": {
"lihi": {
"type": "http",
"url": "https://app.lihi.com/mcp/v1/tools",
"url": "https://app.lihi.io/mcp/v1/tools",
"auth": "oauth"
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/claude/lihi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Other languages: [Traditional Chinese guide](README.zh-TW.md).
This Claude Code plugin registers the remote MCP server `lihi` at:

```text
https://app.lihi.com/mcp/v1/tools
https://app.lihi.io/mcp/v1/tools
```

Its four skills share this single registration:
Expand Down
2 changes: 1 addition & 1 deletion plugins/claude/lihi/README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
此 Claude Code 外掛會註冊遠端 MCP 伺服器 `lihi`:

```text
https://app.lihi.com/mcp/v1/tools
https://app.lihi.io/mcp/v1/tools
```

四個技能共用這一個註冊:
Expand Down
2 changes: 1 addition & 1 deletion plugins/codex/lihi/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lihi",
"version": "0.3.0+codex.20260810060131",
"version": "0.3.1+codex.20260811145402",
"description": "Connect Codex to lihi through one OAuth MCP registration for account status, group and domain switching, and automatic URL shortening.",
"author": {
"name": "lihi",
Expand Down
2 changes: 1 addition & 1 deletion plugins/codex/lihi/.mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mcpServers": {
"lihi": {
"type": "http",
"url": "https://app.lihi.com/mcp/v1/tools",
"url": "https://app.lihi.io/mcp/v1/tools",
"auth": "oauth"
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/codex/lihi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Other languages: [Traditional Chinese guide](README.zh-TW.md).
This Codex plugin registers the remote MCP server `lihi` at:

```text
https://app.lihi.com/mcp/v1/tools
https://app.lihi.io/mcp/v1/tools
```

Its four skills share this single registration:
Expand Down
2 changes: 1 addition & 1 deletion plugins/codex/lihi/README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
此 Codex 外掛會註冊遠端 MCP 伺服器 `lihi`:

```text
https://app.lihi.com/mcp/v1/tools
https://app.lihi.io/mcp/v1/tools
```

四個技能共用這一個註冊:
Expand Down
2 changes: 1 addition & 1 deletion plugins/codex/lihi/skills/lihi-account/agents/openai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
value: "lihi"
description: "lihi account information service"
transport: "streamable_http"
url: "https://app.lihi.com/mcp/v1/tools"
url: "https://app.lihi.io/mcp/v1/tools"
2 changes: 1 addition & 1 deletion plugins/codex/lihi/skills/lihi-shorten/agents/openai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
value: "lihi"
description: "lihi short URL service"
transport: "streamable_http"
url: "https://app.lihi.com/mcp/v1/tools"
url: "https://app.lihi.io/mcp/v1/tools"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
value: "lihi"
description: "lihi account and short URL domain service"
transport: "streamable_http"
url: "https://app.lihi.com/mcp/v1/tools"
url: "https://app.lihi.io/mcp/v1/tools"
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ dependencies:
value: "lihi"
description: "lihi account and work-group service"
transport: "streamable_http"
url: "https://app.lihi.com/mcp/v1/tools"
url: "https://app.lihi.io/mcp/v1/tools"
16 changes: 13 additions & 3 deletions scripts/package_develop_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Iterable, Tuple


PRODUCTION_ORIGIN = "https://app.lihi.com"
PRODUCTION_ORIGIN = "https://app.lihi.io"
DEVELOP_ORIGIN = "https://app.lihidev.com"
PRODUCTION_ENDPOINT = PRODUCTION_ORIGIN + "/mcp/v1/tools"
DEVELOP_ENDPOINT = DEVELOP_ORIGIN + "/mcp/v1/tools"
Expand Down Expand Up @@ -732,8 +732,8 @@ def rewrite_develop_readme(staging_root: Path) -> None:
Path("README.md"),
(
"The production marketplace is available from "
"[weedgood/lihi-agent-plugin.git]"
"(https://github.com/weedgood/lihi-agent-plugin.git). "
"[lihi-io/lihi-agent-plugin.git]"
"(https://github.com/lihi-io/lihi-agent-plugin.git). "
"The plugin selector is `{0}`, displayed as `{1}`.".format(
DEVELOP_PLUGIN_SELECTOR,
DEVELOP_DISPLAY_NAME,
Expand Down Expand Up @@ -782,11 +782,21 @@ def rewrite_develop_readme(staging_root: Path) -> None:
"https://github.com/weedgood/lihi-agent-plugin.git",
"codex plugin marketplace add .",
)
updated = updated.replace(
"codex plugin marketplace add "
"https://github.com/lihi-io/lihi-agent-plugin.git",
"codex plugin marketplace add .",
)
updated = updated.replace(
"claude plugin marketplace add "
"https://github.com/weedgood/lihi-agent-plugin.git",
"claude plugin marketplace add .",
)
updated = updated.replace(
"claude plugin marketplace add "
"https://github.com/lihi-io/lihi-agent-plugin.git",
"claude plugin marketplace add .",
)
if relative_path == Path("README.md"):
updated = updated.replace(
"### Install directly from GitHub",
Expand Down
10 changes: 5 additions & 5 deletions tests/test_account_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path


PRODUCTION_ENDPOINT = "https://app.lihi.com/mcp/v1/tools"
PRODUCTION_ENDPOINT = "https://app.lihi.io/mcp/v1/tools"
SKILLS = (
"lihi-shorten",
"lihi-account",
Expand Down Expand Up @@ -69,8 +69,8 @@ def test_manifests_share_version_and_one_mcp_registration(self):
)
self.assertEqual(codex["name"], "lihi")
self.assertEqual(claude["name"], "lihi")
self.assertTrue(codex["version"].startswith("0.3.0"))
self.assertEqual(claude["version"], "0.3.0")
self.assertTrue(codex["version"].startswith("0.3.1"))
self.assertEqual(claude["version"], "0.3.1")
self.assertEqual(codex["version"].split("+")[0], claude["version"])
self.assertLessEqual(len(codex["interface"]["defaultPrompt"]), 3)
self.assertTrue(
Expand Down Expand Up @@ -490,8 +490,8 @@ def test_docs_freeze_current_contract_and_error_literals(self):
for text in WORK_GROUP_QUOTA_ERRORS:
self.assertIn(text, contract)
self.assertIn(text, guide)
self.assertIn("minimum plugin version `0.3.0`", guide)
self.assertIn("minimum plugin version is 0.3.0", acceptance)
self.assertIn("minimum plugin version `0.3.1`", guide)
self.assertIn("minimum plugin version is 0.3.1", acceptance)
for content in (contract, acceptance, guide):
self.assertNotIn("forbidden_origin", content)
self.assertNotIn("Browser clients are unsupported", content)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_package_develop_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pathlib import Path


PRODUCTION_ENDPOINT = "https://app.lihi.com/mcp/v1/tools"
PRODUCTION_ENDPOINT = "https://app.lihi.io/mcp/v1/tools"
DEVELOP_ENDPOINT = "https://app.lihidev.com/mcp/v1/tools"
PRODUCTION_SKILLS = (
"lihi-shorten",
Expand Down Expand Up @@ -77,7 +77,7 @@ def setUpClass(cls):
)
cls.source_hash_after = tree_hash(cls.repo_root, cls.source_paths)
cls.source_hash_before = before
cls.version = "0.3.0-develop.42"
cls.version = "0.3.1-develop.42"
cls.package = cls.output_dir / ("lihi-agent-" + cls.version)

@classmethod
Expand All @@ -96,9 +96,9 @@ def test_subprocess_build_succeeds_without_modifying_source(self):
def test_version_helpers_enforce_shared_semver_core(self):
self.assertEqual(
self.packager.semantic_version_core(
"0.3.0+codex.cache", Path("manifest.json")
"0.3.1+codex.cache", Path("manifest.json")
),
"0.3.0",
"0.3.1",
)
with self.assertRaises(self.packager.PackagingError):
self.packager.semantic_version_core("0.3", Path("manifest.json"))
Expand Down