opencodekit 0.20.8 → 0.21.1

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.
Files changed (48) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +25 -1
  3. package/dist/template/.opencode/memory.db +0 -0
  4. package/dist/template/.opencode/memory.db-shm +0 -0
  5. package/dist/template/.opencode/memory.db-wal +0 -0
  6. package/dist/template/.opencode/opencode.json +83 -609
  7. package/dist/template/.opencode/opencodex-fast.jsonc +1 -1
  8. package/dist/template/.opencode/package.json +2 -2
  9. package/dist/template/.opencode/plugin/copilot-auth.ts +86 -12
  10. package/dist/template/.opencode/plugin/prompt-leverage.ts +191 -0
  11. package/dist/template/.opencode/plugin/sdk/copilot/copilot-provider.ts +14 -2
  12. package/dist/template/.opencode/plugin/sdk/copilot/index.ts +2 -2
  13. package/dist/template/.opencode/plugin/sdk/copilot/responses/convert-to-openai-responses-input.ts +335 -0
  14. package/dist/template/.opencode/plugin/sdk/copilot/responses/map-openai-responses-finish-reason.ts +22 -0
  15. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-config.ts +18 -0
  16. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-error.ts +22 -0
  17. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-api-types.ts +214 -0
  18. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-language-model.ts +1770 -0
  19. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-prepare-tools.ts +173 -0
  20. package/dist/template/.opencode/plugin/sdk/copilot/responses/openai-responses-settings.ts +1 -0
  21. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/code-interpreter.ts +87 -0
  22. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/file-search.ts +127 -0
  23. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/image-generation.ts +114 -0
  24. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/local-shell.ts +64 -0
  25. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/web-search-preview.ts +103 -0
  26. package/dist/template/.opencode/plugin/sdk/copilot/responses/tool/web-search.ts +102 -0
  27. package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +29 -0
  28. package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +237 -0
  29. package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +38 -0
  30. package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +509 -0
  31. package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +90 -0
  32. package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +91 -0
  33. package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +157 -0
  34. package/dist/template/.opencode/skill/screenshot/SKILL.md +48 -0
  35. package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +54 -0
  36. package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +22 -0
  37. package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +40 -0
  38. package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +126 -0
  39. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +163 -0
  40. package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +585 -0
  41. package/dist/template/.opencode/skill/security-threat-model/SKILL.md +36 -0
  42. package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +255 -0
  43. package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +32 -0
  44. package/dist/template/.opencode/skill/skill-installer/SKILL.md +58 -0
  45. package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +21 -0
  46. package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +313 -0
  47. package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +106 -0
  48. package/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env python3
2
+ """List skills from a GitHub repo path."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import json
8
+ import os
9
+ import sys
10
+ import urllib.error
11
+
12
+ from github_utils import github_api_contents_url, github_request
13
+
14
+ DEFAULT_REPO = "openai/skills"
15
+ DEFAULT_PATH = "skills/.curated"
16
+ DEFAULT_REF = "main"
17
+
18
+
19
+ class ListError(Exception):
20
+ pass
21
+
22
+
23
+ class Args(argparse.Namespace):
24
+ repo: str
25
+ path: str
26
+ ref: str
27
+ format: str
28
+
29
+
30
+ def _request(url: str) -> bytes:
31
+ return github_request(url, "opencode-skill-list")
32
+
33
+
34
+ def _opencode_home() -> str:
35
+ return os.environ.get("OPENCODE_HOME", os.path.expanduser("~/.config/opencode"))
36
+
37
+
38
+ def _installed_skills() -> set[str]:
39
+ root = os.path.join(_opencode_home(), "skill")
40
+ if not os.path.isdir(root):
41
+ return set()
42
+ entries = set()
43
+ for name in os.listdir(root):
44
+ path = os.path.join(root, name)
45
+ if os.path.isdir(path):
46
+ entries.add(name)
47
+ return entries
48
+
49
+
50
+ def _list_skills(repo: str, path: str, ref: str) -> list[str]:
51
+ api_url = github_api_contents_url(repo, path, ref)
52
+ try:
53
+ payload = _request(api_url)
54
+ except urllib.error.HTTPError as exc:
55
+ if exc.code == 404:
56
+ raise ListError(
57
+ f"Skills path not found: https://github.com/{repo}/tree/{ref}/{path}"
58
+ ) from exc
59
+ raise ListError(f"Failed to fetch skills: HTTP {exc.code}") from exc
60
+ data = json.loads(payload.decode("utf-8"))
61
+ if not isinstance(data, list):
62
+ raise ListError("Unexpected skills listing response.")
63
+ skills = [item["name"] for item in data if item.get("type") == "dir"]
64
+ return sorted(skills)
65
+
66
+
67
+ def _parse_args(argv: list[str]) -> Args:
68
+ parser = argparse.ArgumentParser(description="List skills.")
69
+ parser.add_argument("--repo", default=DEFAULT_REPO)
70
+ parser.add_argument(
71
+ "--path",
72
+ default=DEFAULT_PATH,
73
+ help="Repo path to list (default: skills/.curated)",
74
+ )
75
+ parser.add_argument("--ref", default=DEFAULT_REF)
76
+ parser.add_argument(
77
+ "--format",
78
+ choices=["text", "json"],
79
+ default="text",
80
+ help="Output format",
81
+ )
82
+ return parser.parse_args(argv, namespace=Args())
83
+
84
+
85
+ def main(argv: list[str]) -> int:
86
+ args = _parse_args(argv)
87
+ try:
88
+ skills = _list_skills(args.repo, args.path, args.ref)
89
+ installed = _installed_skills()
90
+ if args.format == "json":
91
+ payload = [
92
+ {"name": name, "installed": name in installed} for name in skills
93
+ ]
94
+ print(json.dumps(payload))
95
+ else:
96
+ for idx, name in enumerate(skills, start=1):
97
+ suffix = " (already installed)" if name in installed else ""
98
+ print(f"{idx}. {name}{suffix}")
99
+ return 0
100
+ except ListError as exc:
101
+ print(f"Error: {exc}", file=sys.stderr)
102
+ return 1
103
+
104
+
105
+ if __name__ == "__main__":
106
+ raise SystemExit(main(sys.argv[1:]))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodekit",
3
- "version": "0.20.8",
3
+ "version": "0.21.1",
4
4
  "description": "CLI tool for bootstrapping and managing OpenCodeKit projects",
5
5
  "keywords": [
6
6
  "agents",