@nomadamas/k-skill 0.4.2 → 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.
- package/package.json +1 -1
- package/skills/animal-pharmacy-search/instruction.md +150 -0
- package/skills/animal-pharmacy-search/scripts/animal_pharmacy_mcp.py +276 -0
- package/skills/animal-pharmacy-search/skill.json +8 -0
- package/skills/consumer-price-safety-search/instruction.md +30 -0
- package/skills/consumer-price-safety-search/skill.json +6 -0
- package/skills/coupang-product-search/instruction.md +59 -188
- package/skills/coupang-product-search/skill.json +6 -2
- package/skills/daiso-product-search/instruction.md +11 -1
- package/skills/fsc-corporate-info/instruction.md +2 -1
- package/skills/fsc-corporate-info/scripts/test_fsc_corporate_info.py +42 -0
- package/skills/g2b-sanctioned-supplier/instruction.md +2 -1
- package/skills/g2b-sanctioned-supplier/scripts/test_g2b_sanctioned_supplier.py +33 -0
- package/skills/government-support-survey/instruction.md +52 -0
- package/skills/government-support-survey/references/NOTICE.md +30 -0
- package/skills/government-support-survey/scripts/run_survey.py +71 -0
- package/skills/government-support-survey/skill.json +10 -0
- package/skills/kamis-food-price/instruction.md +66 -0
- package/skills/kamis-food-price/scripts/run_kamis.py +110 -0
- package/skills/kamis-food-price/skill.json +9 -0
- package/skills/korean-cinema-search/instruction.md +7 -1
- package/skills/market-kurly-search/instruction.md +9 -1
- package/skills/mofa-travel-safety/instruction.md +62 -0
- package/skills/mofa-travel-safety/scripts/run_mofa_travel_safety.py +57 -0
- package/skills/mofa-travel-safety/skill.json +9 -0
- package/skills/nts-tax-delinquency/instruction.md +2 -1
- package/skills/nts-tax-delinquency/scripts/nts_tax_delinquency.py +15 -1
- package/skills/nts-tax-delinquency/scripts/test_nts_tax_delinquency.py +32 -0
- package/skills/seoul-weather-risk/instruction.md +4 -1
- package/skills/seoul-weather-risk/scripts/seoul_weather_risk.py +99 -3
- package/skills/store-longevity-radar/scripts/__pycache__/store_longevity_download.cpython-312.pyc +0 -0
- package/templates/browser.md +1 -1
- package/skills/coupang-product-search/scripts/coupang_partners_mcp.py +0 -146
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Bootstrap and run retention-corp/coupang_partners Coupang MCP tools.
|
|
3
|
-
|
|
4
|
-
The k-skill repo intentionally does not vendor the third-party implementation.
|
|
5
|
-
This wrapper keeps the skill pointed at the approved upstream repository, clones it
|
|
6
|
-
into a user cache when needed, and then delegates to its local MCP-compatible CLI.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from __future__ import annotations
|
|
10
|
-
|
|
11
|
-
import argparse
|
|
12
|
-
import os
|
|
13
|
-
import pathlib
|
|
14
|
-
import subprocess
|
|
15
|
-
import sys
|
|
16
|
-
from typing import Sequence
|
|
17
|
-
|
|
18
|
-
UPSTREAM_REPO_URL = "https://github.com/retention-corp/coupang_partners.git"
|
|
19
|
-
DEFAULT_MCP_ENDPOINT = "local://coupang-mcp"
|
|
20
|
-
DEFAULT_REPO_DIR = pathlib.Path(os.getenv("COUPANG_PARTNERS_REPO_DIR", "~/.cache/k-skill/coupang_partners")).expanduser()
|
|
21
|
-
UPSTREAM_CLI = pathlib.Path("bin") / "coupang_mcp.py"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class BootstrapError(RuntimeError):
|
|
25
|
-
"""Raised when the upstream checkout cannot be prepared."""
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
|
|
29
|
-
parser = argparse.ArgumentParser(
|
|
30
|
-
description="Run the retention-corp/coupang_partners local Coupang MCP-compatible CLI.",
|
|
31
|
-
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
32
|
-
epilog=(
|
|
33
|
-
"Examples:\n"
|
|
34
|
-
" coupang_partners_mcp.py tools\n"
|
|
35
|
-
" coupang_partners_mcp.py init\n"
|
|
36
|
-
" coupang_partners_mcp.py search 생수\n"
|
|
37
|
-
" coupang_partners_mcp.py budget 키보드 --max-price 100000\n"
|
|
38
|
-
"\n"
|
|
39
|
-
"Honored upstream environment variables (forwarded as-is):\n"
|
|
40
|
-
" COUPANG_ACCESS_KEY, COUPANG_SECRET_KEY\n"
|
|
41
|
-
" Operator Coupang Partners API credentials. When set, upstream\n"
|
|
42
|
-
" uses the local HMAC-signed Coupang Partners path.\n"
|
|
43
|
-
" OPENCLAW_SHOPPING_CLIENT_ID\n"
|
|
44
|
-
" Allowlisted client id for the hosted fallback. upstream sends\n"
|
|
45
|
-
" openclaw-skill by default, which is the value currently on the\n"
|
|
46
|
-
" Retention Corp allowlist; k-skill does not override this.\n"
|
|
47
|
-
" OPENCLAW_SHOPPING_FORCE_HOSTED=1\n"
|
|
48
|
-
" Force the hosted fallback even when Coupang keys are present.\n"
|
|
49
|
-
" OPENCLAW_SHOPPING_BASE_URL\n"
|
|
50
|
-
" Override the hosted backend base URL. Default upstream target\n"
|
|
51
|
-
" is https://a.retn.kr and /v1/public/assist is the public entry.\n"
|
|
52
|
-
"\n"
|
|
53
|
-
"When both COUPANG_ACCESS_KEY and COUPANG_SECRET_KEY are missing,\n"
|
|
54
|
-
"upstream falls back to the hosted Retention Corp backend so this\n"
|
|
55
|
-
"skill keeps working without Coupang Partners credentials."
|
|
56
|
-
),
|
|
57
|
-
)
|
|
58
|
-
parser.add_argument(
|
|
59
|
-
"--repo-dir",
|
|
60
|
-
default=str(DEFAULT_REPO_DIR),
|
|
61
|
-
help="Checkout directory for retention-corp/coupang_partners (default: %(default)s).",
|
|
62
|
-
)
|
|
63
|
-
parser.add_argument(
|
|
64
|
-
"--no-clone",
|
|
65
|
-
action="store_true",
|
|
66
|
-
help="Do not clone the upstream repository if it is missing; fail with setup guidance instead.",
|
|
67
|
-
)
|
|
68
|
-
parser.add_argument(
|
|
69
|
-
"--update",
|
|
70
|
-
action="store_true",
|
|
71
|
-
help="Run git pull --ff-only in an existing upstream checkout before delegating.",
|
|
72
|
-
)
|
|
73
|
-
parser.add_argument(
|
|
74
|
-
"upstream_args",
|
|
75
|
-
nargs=argparse.REMAINDER,
|
|
76
|
-
help="Arguments passed to bin/coupang_mcp.py, for example: tools, search 생수, rocket 에어팟.",
|
|
77
|
-
)
|
|
78
|
-
args = parser.parse_args(argv)
|
|
79
|
-
if args.upstream_args and args.upstream_args[0] == "--":
|
|
80
|
-
args.upstream_args = args.upstream_args[1:]
|
|
81
|
-
if not args.upstream_args:
|
|
82
|
-
parser.error("missing upstream command; try: tools, init, search <keyword>, rocket <keyword>, budget <keyword>")
|
|
83
|
-
return args
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
def upstream_cli_path(repo_dir: pathlib.Path) -> pathlib.Path:
|
|
87
|
-
return repo_dir / UPSTREAM_CLI
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def ensure_repo(repo_dir: pathlib.Path, *, clone: bool = True, update: bool = False) -> pathlib.Path:
|
|
91
|
-
cli_path = upstream_cli_path(repo_dir)
|
|
92
|
-
if cli_path.exists():
|
|
93
|
-
if update:
|
|
94
|
-
run_checked(["git", "-C", str(repo_dir), "pull", "--ff-only"], "failed to update upstream checkout")
|
|
95
|
-
return cli_path
|
|
96
|
-
|
|
97
|
-
if repo_dir.exists():
|
|
98
|
-
raise BootstrapError(
|
|
99
|
-
f"{repo_dir} exists but does not look like retention-corp/coupang_partners "
|
|
100
|
-
f"(missing {UPSTREAM_CLI}). Recreate it with: git clone {UPSTREAM_REPO_URL} {repo_dir}"
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
if not clone:
|
|
104
|
-
raise BootstrapError(
|
|
105
|
-
f"Missing retention-corp/coupang_partners checkout at {repo_dir}. "
|
|
106
|
-
f"Create it with: git clone {UPSTREAM_REPO_URL} {repo_dir}"
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
repo_dir.parent.mkdir(parents=True, exist_ok=True)
|
|
110
|
-
run_checked(["git", "clone", "--depth", "1", UPSTREAM_REPO_URL, str(repo_dir)], "failed to clone upstream checkout")
|
|
111
|
-
if not cli_path.exists():
|
|
112
|
-
raise BootstrapError(f"Cloned {UPSTREAM_REPO_URL}, but {UPSTREAM_CLI} was not found in {repo_dir}")
|
|
113
|
-
return cli_path
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def run_checked(command: Sequence[str], context: str) -> None:
|
|
117
|
-
try:
|
|
118
|
-
subprocess.run(command, check=True)
|
|
119
|
-
except FileNotFoundError as exc:
|
|
120
|
-
raise BootstrapError(f"{context}: required executable not found: {command[0]}") from exc
|
|
121
|
-
except subprocess.CalledProcessError as exc:
|
|
122
|
-
raise BootstrapError(f"{context}: {exc}") from exc
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
def build_command(cli_path: pathlib.Path, upstream_args: Sequence[str]) -> list[str]:
|
|
126
|
-
return [sys.executable, str(cli_path), *upstream_args]
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
def main(argv: Sequence[str] | None = None) -> int:
|
|
130
|
-
args = parse_args(argv)
|
|
131
|
-
repo_dir = pathlib.Path(args.repo_dir).expanduser().resolve()
|
|
132
|
-
|
|
133
|
-
try:
|
|
134
|
-
cli_path = ensure_repo(repo_dir, clone=not args.no_clone, update=args.update)
|
|
135
|
-
except BootstrapError as exc:
|
|
136
|
-
print(f"coupang_partners_mcp.py: {exc}", file=sys.stderr)
|
|
137
|
-
return 2
|
|
138
|
-
|
|
139
|
-
env = os.environ.copy()
|
|
140
|
-
env.setdefault("COUPANG_MCP_ENDPOINT", DEFAULT_MCP_ENDPOINT)
|
|
141
|
-
completed = subprocess.run(build_command(cli_path, args.upstream_args), env=env)
|
|
142
|
-
return int(completed.returncode)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if __name__ == "__main__":
|
|
146
|
-
raise SystemExit(main())
|