pactkit-opencode 4.4.0__py3-none-any.whl → 4.4.2__py3-none-any.whl
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.
- pactkit_opencode/declarations.py +6 -0
- pactkit_opencode/deployer.py +30 -3
- {pactkit_opencode-4.4.0.dist-info → pactkit_opencode-4.4.2.dist-info}/METADATA +2 -2
- pactkit_opencode-4.4.2.dist-info/RECORD +9 -0
- pactkit_opencode-4.4.0.dist-info/RECORD +0 -9
- {pactkit_opencode-4.4.0.dist-info → pactkit_opencode-4.4.2.dist-info}/WHEEL +0 -0
- {pactkit_opencode-4.4.0.dist-info → pactkit_opencode-4.4.2.dist-info}/entry_points.txt +0 -0
- {pactkit_opencode-4.4.0.dist-info → pactkit_opencode-4.4.2.dist-info}/top_level.txt +0 -0
pactkit_opencode/declarations.py
CHANGED
|
@@ -65,6 +65,12 @@ PROFILE = FormatProfile(
|
|
|
65
65
|
rules_import_style='inline',
|
|
66
66
|
excluded_agent_fields=frozenset({'memory', 'permissionMode', 'skills'}),
|
|
67
67
|
excluded_commands=frozenset(),
|
|
68
|
+
# OpenCode (the host) supports model routing via model+template command
|
|
69
|
+
# entries — this flag records that host capability and is the distinguishing
|
|
70
|
+
# True in the capability set (the v4 §10.3 guard requires the flag to vary).
|
|
71
|
+
# The adapter does NOT write model-only routing (OpenCode rejects it); when
|
|
72
|
+
# command_models is set it warns explicitly rather than silently ignoring it
|
|
73
|
+
# (STORY-slim-202611196170677f83b5).
|
|
68
74
|
supports_model_routing=True,
|
|
69
75
|
skills_path_var='~/.config/opencode/skills',
|
|
70
76
|
command_deploy_form='flat',
|
pactkit_opencode/deployer.py
CHANGED
|
@@ -196,8 +196,13 @@ class OpenCodeDeployer(DeployerBase):
|
|
|
196
196
|
# Clean up legacy command skills from skills/ directory (migrated to commands/)
|
|
197
197
|
self._cleanup_command_skills(skills_dir)
|
|
198
198
|
|
|
199
|
-
# Apply CLI-to-script replacement to
|
|
199
|
+
# Apply CLI-to-script replacement ONLY to PactKit-managed skill files
|
|
200
|
+
# (STORY-slim-202611239641dc45a9fc): user-created skills stay untouched.
|
|
201
|
+
from pactkit.prompts.skills import get_skill_manifest
|
|
202
|
+
_skill_names = {s["name"] for s in get_skill_manifest()}
|
|
200
203
|
for skill_md in skills_dir.glob("*/SKILL.md"):
|
|
204
|
+
if skill_md.parent.name not in _skill_names:
|
|
205
|
+
continue
|
|
201
206
|
content = skill_md.read_text(encoding="utf-8")
|
|
202
207
|
replaced = _replace_cli_with_scripts(content)
|
|
203
208
|
if replaced != content:
|
|
@@ -209,6 +214,8 @@ class OpenCodeDeployer(DeployerBase):
|
|
|
209
214
|
from pactkit.deploy_manifest import record_deployed_file
|
|
210
215
|
|
|
211
216
|
for skill_md in skills_dir.glob("*/SKILL.md"):
|
|
217
|
+
if skill_md.parent.name not in _skill_names:
|
|
218
|
+
continue
|
|
212
219
|
record_deployed_file(
|
|
213
220
|
opencode_root, skill_md.relative_to(opencode_root).as_posix(),
|
|
214
221
|
)
|
|
@@ -216,14 +223,21 @@ class OpenCodeDeployer(DeployerBase):
|
|
|
216
223
|
# Deploy commands to commands/ directory (OpenCode uses /command-name to invoke)
|
|
217
224
|
n_commands = _deploy_commands(commands_dir, enabled_commands, profile=self.profile, config=cfg)
|
|
218
225
|
|
|
219
|
-
# Apply CLI-to-script replacement to
|
|
226
|
+
# Apply CLI-to-script replacement ONLY to PactKit-managed command files
|
|
227
|
+
# (STORY-slim-202611239641dc45a9fc): user-created commands stay untouched.
|
|
228
|
+
from pactkit.prompts.commands import get_deployable_commands
|
|
229
|
+
_cmd_catalog = set(get_deployable_commands())
|
|
220
230
|
for cmd_md in commands_dir.glob("*.md"):
|
|
231
|
+
if cmd_md.name not in _cmd_catalog:
|
|
232
|
+
continue
|
|
221
233
|
content = cmd_md.read_text(encoding="utf-8")
|
|
222
234
|
replaced = _replace_cli_with_scripts(content)
|
|
223
235
|
if replaced != content:
|
|
224
236
|
atomic_write(cmd_md, replaced)
|
|
225
237
|
|
|
226
238
|
for cmd_md in commands_dir.glob("*.md"):
|
|
239
|
+
if cmd_md.name not in _cmd_catalog:
|
|
240
|
+
continue
|
|
227
241
|
record_deployed_file(
|
|
228
242
|
opencode_root, cmd_md.relative_to(opencode_root).as_posix(),
|
|
229
243
|
)
|
|
@@ -237,6 +251,15 @@ class OpenCodeDeployer(DeployerBase):
|
|
|
237
251
|
Path(self.profile.global_config_dir).expanduser()
|
|
238
252
|
)
|
|
239
253
|
command_models = cfg.get("command_models", {})
|
|
254
|
+
if command_models:
|
|
255
|
+
# Honesty (STORY-slim-202611196170677f83b5): OpenCode requires
|
|
256
|
+
# model+template command entries; model-only routing is not written,
|
|
257
|
+
# so this config is ignored. Say so instead of silently dropping it.
|
|
258
|
+
print(
|
|
259
|
+
" ⚠️ command_models is set but OpenCode does not consume model-only "
|
|
260
|
+
"command routing (its command entries require model+template); "
|
|
261
|
+
"this configuration is not applied."
|
|
262
|
+
)
|
|
240
263
|
self._update_global_opencode_json(
|
|
241
264
|
opencode_root,
|
|
242
265
|
command_models=command_models,
|
|
@@ -367,7 +390,11 @@ class OpenCodeDeployer(DeployerBase):
|
|
|
367
390
|
"A user-invoked PactKit command loads only its own phase contract and declared shared modules.",
|
|
368
391
|
"",
|
|
369
392
|
]
|
|
370
|
-
|
|
393
|
+
# Global AGENTS.md is a user document with a PactKit-managed region;
|
|
394
|
+
# merge-semantics preserve user content (STORY-slim-20261120528a3b6615d3).
|
|
395
|
+
from pactkit.managed_docs import RUNTIME_INDEX_VERSION_RE, upsert_managed_block
|
|
396
|
+
upsert_managed_block(opencode_root / "AGENTS.md", "\n".join(lines),
|
|
397
|
+
legacy_version_pattern=RUNTIME_INDEX_VERSION_RE)
|
|
371
398
|
|
|
372
399
|
@staticmethod
|
|
373
400
|
def _resolve_opencode_model_id(short_name, providers):
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
pactkit_opencode/__init__.py,sha256=eUyhW1gUrXXAgcGgPjNm-eddx7rji35WuzncsAqiW5U,934
|
|
2
|
+
pactkit_opencode/declarations.py,sha256=UNPSQZWn9aeZv4cEvyzeT0mztgsMyft_hkoYGA25ceI,9257
|
|
3
|
+
pactkit_opencode/deployer.py,sha256=oF4tMbLwt4pQ4XPUzZtn1lQOcoCVVh9PRzqd_9QIj5E,25766
|
|
4
|
+
pactkit_opencode/enforcement.py,sha256=aOaNYU30rF67PfJNSLXubAwJJfw88UbkE1JDDb7XGec,2897
|
|
5
|
+
pactkit_opencode-4.4.2.dist-info/METADATA,sha256=JSBNjcwNw8xLhVJPu4p7S1Ykr2W1DrVCqTxPh3geOiQ,187
|
|
6
|
+
pactkit_opencode-4.4.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
7
|
+
pactkit_opencode-4.4.2.dist-info/entry_points.txt,sha256=By7lE89sPCfucVIOpDRWK2biKi_ZarkCltUidcCAo6Y,65
|
|
8
|
+
pactkit_opencode-4.4.2.dist-info/top_level.txt,sha256=kmFfcuDMNxmyylzdSsieob_DGbBJ43YN1_DOZMIrudA,17
|
|
9
|
+
pactkit_opencode-4.4.2.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
pactkit_opencode/__init__.py,sha256=eUyhW1gUrXXAgcGgPjNm-eddx7rji35WuzncsAqiW5U,934
|
|
2
|
-
pactkit_opencode/declarations.py,sha256=5AhLDUafvCqzMBE2L5b-Rc2eH4T6ietI6LQp35hiXTA,8814
|
|
3
|
-
pactkit_opencode/deployer.py,sha256=3YTfylq37dWCSSovUVmnghz-GZMAo9CKMHQKwZbJWNo,24179
|
|
4
|
-
pactkit_opencode/enforcement.py,sha256=aOaNYU30rF67PfJNSLXubAwJJfw88UbkE1JDDb7XGec,2897
|
|
5
|
-
pactkit_opencode-4.4.0.dist-info/METADATA,sha256=sTas1LZHhW8sNC0Z36qXPD_PIVrWruVsZJJCmDsvzyk,187
|
|
6
|
-
pactkit_opencode-4.4.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
7
|
-
pactkit_opencode-4.4.0.dist-info/entry_points.txt,sha256=By7lE89sPCfucVIOpDRWK2biKi_ZarkCltUidcCAo6Y,65
|
|
8
|
-
pactkit_opencode-4.4.0.dist-info/top_level.txt,sha256=kmFfcuDMNxmyylzdSsieob_DGbBJ43YN1_DOZMIrudA,17
|
|
9
|
-
pactkit_opencode-4.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|