agent-devkit 0.2.0 → 0.3.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/README.md +48 -6
- package/bin/agent.mjs +133 -7
- package/package.json +1 -1
- package/runtime/README.md +187 -5
- package/runtime/agent +31 -5
- package/runtime/agents/README.md +18 -0
- package/runtime/agents/contribution-reviewer/AGENTS.md +8 -0
- package/runtime/agents/contribution-reviewer/README.md +8 -0
- package/runtime/agents/contribution-reviewer/agent.yaml +40 -0
- package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/capability.yaml +27 -0
- package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/decision-rules.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/workflow.md +6 -0
- package/runtime/agents/contribution-reviewer/capabilities/review-contribution/capability.yaml +25 -0
- package/runtime/agents/contribution-reviewer/capabilities/review-contribution/decision-rules.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/review-contribution/workflow.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/capability.yaml +26 -0
- package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/decision-rules.md +5 -0
- package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/workflow.md +6 -0
- package/runtime/agents/contribution-reviewer/infra/README.md +6 -0
- package/runtime/agents/contribution-reviewer/knowledge/context.md +8 -0
- package/runtime/agents/contribution-reviewer/knowledge/system.md +8 -0
- package/runtime/agents/contribution-reviewer/templates/README.md +3 -0
- package/runtime/agents/knowledge-author/AGENTS.md +7 -0
- package/runtime/agents/knowledge-author/README.md +7 -0
- package/runtime/agents/knowledge-author/agent.yaml +37 -0
- package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/capability.yaml +30 -0
- package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/decision-rules.md +6 -0
- package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/workflow.md +7 -0
- package/runtime/agents/knowledge-author/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-author/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-author/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-author/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-curator/AGENTS.md +7 -0
- package/runtime/agents/knowledge-curator/README.md +6 -0
- package/runtime/agents/knowledge-curator/agent.yaml +37 -0
- package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/capability.yaml +29 -0
- package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/decision-rules.md +6 -0
- package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/workflow.md +7 -0
- package/runtime/agents/knowledge-curator/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-curator/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-curator/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-curator/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-infra-builder/AGENTS.md +8 -0
- package/runtime/agents/knowledge-infra-builder/README.md +8 -0
- package/runtime/agents/knowledge-infra-builder/agent.yaml +38 -0
- package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/capability.yaml +30 -0
- package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/decision-rules.md +6 -0
- package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/workflow.md +7 -0
- package/runtime/agents/knowledge-infra-builder/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-infra-builder/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-infra-builder/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-infra-builder/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-owner/AGENTS.md +7 -0
- package/runtime/agents/knowledge-owner/README.md +6 -0
- package/runtime/agents/knowledge-owner/agent.yaml +37 -0
- package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/capability.yaml +28 -0
- package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/decision-rules.md +6 -0
- package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/workflow.md +7 -0
- package/runtime/agents/knowledge-owner/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-owner/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-owner/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-owner/templates/.gitkeep +1 -0
- package/runtime/agents/knowledge-reviewer/AGENTS.md +7 -0
- package/runtime/agents/knowledge-reviewer/README.md +7 -0
- package/runtime/agents/knowledge-reviewer/agent.yaml +36 -0
- package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/capability.yaml +26 -0
- package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/decision-rules.md +6 -0
- package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/workflow.md +7 -0
- package/runtime/agents/knowledge-reviewer/infra/.gitkeep +1 -0
- package/runtime/agents/knowledge-reviewer/knowledge/context.md +4 -0
- package/runtime/agents/knowledge-reviewer/knowledge/system.md +4 -0
- package/runtime/agents/knowledge-reviewer/templates/.gitkeep +1 -0
- package/runtime/agents/local-memory-manager/AGENTS.md +5 -0
- package/runtime/agents/local-memory-manager/README.md +7 -0
- package/runtime/agents/local-memory-manager/agent.yaml +38 -0
- package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/capability.yaml +19 -0
- package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/decision-rules.md +5 -0
- package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/workflow.md +6 -0
- package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/capability.yaml +19 -0
- package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/decision-rules.md +5 -0
- package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/workflow.md +5 -0
- package/runtime/agents/local-memory-manager/infra/.gitkeep +1 -0
- package/runtime/agents/local-memory-manager/knowledge/context.md +4 -0
- package/runtime/agents/local-memory-manager/knowledge/system.md +4 -0
- package/runtime/agents/local-memory-manager/templates/.gitkeep +1 -0
- package/runtime/agents/memory-sync-manager/AGENTS.md +7 -0
- package/runtime/agents/memory-sync-manager/README.md +7 -0
- package/runtime/agents/memory-sync-manager/agent.yaml +37 -0
- package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/capability.yaml +29 -0
- package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/decision-rules.md +6 -0
- package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/workflow.md +7 -0
- package/runtime/agents/memory-sync-manager/infra/.gitkeep +1 -0
- package/runtime/agents/memory-sync-manager/knowledge/context.md +4 -0
- package/runtime/agents/memory-sync-manager/knowledge/system.md +4 -0
- package/runtime/agents/memory-sync-manager/templates/.gitkeep +1 -0
- package/runtime/agents/shared-memory-curator/AGENTS.md +5 -0
- package/runtime/agents/shared-memory-curator/README.md +6 -0
- package/runtime/agents/shared-memory-curator/agent.yaml +38 -0
- package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/capability.yaml +19 -0
- package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/decision-rules.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/workflow.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/capability.yaml +19 -0
- package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/decision-rules.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/workflow.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/capability.yaml +19 -0
- package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/decision-rules.md +5 -0
- package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/workflow.md +5 -0
- package/runtime/agents/shared-memory-curator/infra/.gitkeep +1 -0
- package/runtime/agents/shared-memory-curator/knowledge/context.md +5 -0
- package/runtime/agents/shared-memory-curator/knowledge/system.md +4 -0
- package/runtime/agents/shared-memory-curator/templates/.gitkeep +1 -0
- package/runtime/cli/README.md +35 -4
- package/runtime/cli/aikit/__init__.py +1 -1
- package/runtime/cli/aikit/agent_registry.py +4 -2
- package/runtime/cli/aikit/agentic_commands.py +158 -0
- package/runtime/cli/aikit/app_home.py +1 -0
- package/runtime/cli/aikit/audit.py +16 -6
- package/runtime/cli/aikit/catalog.py +278 -8
- package/runtime/cli/aikit/cli_dispatch.py +489 -13
- package/runtime/cli/aikit/cli_parser.py +145 -7
- package/runtime/cli/aikit/contribution.py +132 -2
- package/runtime/cli/aikit/doctor_runtime.py +85 -0
- package/runtime/cli/aikit/eval.py +356 -10
- package/runtime/cli/aikit/human_output.py +310 -4
- package/runtime/cli/aikit/interactive_wizard.py +148 -0
- package/runtime/cli/aikit/knowledge_base.py +1067 -0
- package/runtime/cli/aikit/llm.py +12 -4
- package/runtime/cli/aikit/local_artifacts.py +444 -0
- package/runtime/cli/aikit/local_llm.py +161 -0
- package/runtime/cli/aikit/main.py +15 -0
- package/runtime/cli/aikit/mcp_manifest.py +798 -0
- package/runtime/cli/aikit/mcp_tools.py +643 -5
- package/runtime/cli/aikit/memory.py +405 -0
- package/runtime/cli/aikit/mini_brain.py +20 -1
- package/runtime/cli/aikit/natural_prompt_runtime.py +125 -1
- package/runtime/cli/aikit/ollama.py +64 -15
- package/runtime/cli/aikit/onboarding.py +551 -0
- package/runtime/cli/aikit/output.py +67 -0
- package/runtime/cli/aikit/prompt_injection.py +12 -1
- package/runtime/cli/aikit/roadmap_cli.py +1 -1
- package/runtime/cli/aikit/secrets.py +3 -2
- package/runtime/cli/aikit/setup_wizard_payload.py +3 -0
- package/runtime/cli/aikit/shared_memory.py +415 -0
- package/runtime/cli/aikit/specialist_readiness.py +152 -0
- package/runtime/cli/aikit/tasks.py +104 -1
- package/runtime/cli/aikit/team.py +380 -0
- package/runtime/cli/aikit/toolchain.py +7 -2
- package/runtime/cli/aikit/workflows.py +115 -14
- package/runtime/providers/knowledge-github.yaml +40 -0
- package/runtime/providers/knowledge-google-drive.yaml +32 -0
- package/runtime/providers/knowledge-local.yaml +26 -0
- package/runtime/providers/knowledge-notion.yaml +32 -0
- package/runtime/providers/knowledge-obsidian.yaml +24 -0
- package/runtime/providers/knowledge-onedrive.yaml +36 -0
- package/runtime/providers/knowledge-s3.yaml +45 -0
- package/runtime/providers/knowledge-sharepoint.yaml +39 -0
- package/runtime/providers/knowledge-supabase.yaml +43 -0
- package/runtime/providers/knowledge-vector.yaml +39 -0
- package/runtime/requirements.txt +6 -0
- package/runtime/scripts/docker-cli-qa.sh +453 -0
- package/runtime/scripts/release-catalog-snapshot.json +55 -4
- package/runtime/scripts/release-gate.py +54 -13
- package/runtime/tooling/toolchain.yaml +92 -0
- package/runtime/vendor/skills/napkin/napkin.md +21 -7
- package/runtime/workflows/azure-card-analysis/README.md +3 -0
- package/runtime/workflows/azure-card-analysis/workflow.yaml +30 -0
- package/runtime/workflows/daily-pr-review/README.md +3 -0
- package/runtime/workflows/daily-pr-review/workflow.yaml +31 -0
- package/runtime/workflows/incident-analysis/README.md +3 -0
- package/runtime/workflows/incident-analysis/workflow.yaml +33 -0
- package/runtime/workflows/release-prep/README.md +3 -0
- package/runtime/workflows/release-prep/workflow.yaml +30 -0
|
@@ -8,16 +8,18 @@ from typing import Any
|
|
|
8
8
|
|
|
9
9
|
from cli.aikit import __version__
|
|
10
10
|
from cli.aikit.aliases import add_alias, list_aliases, remove_alias, sync_aliases
|
|
11
|
+
from cli.aikit.agentic_commands import agentic_execute, agentic_plan
|
|
11
12
|
from cli.aikit.app_home import app_home_status, migrate_default_home
|
|
12
13
|
from cli.aikit.architecture import architecture_contract
|
|
13
14
|
from cli.aikit.audit import export_audit, list_audits, record_audit, show_audit, try_record_audit
|
|
14
15
|
from cli.aikit.calendar import calendar_list, calendar_today, calendar_tomorrow, configure_calendar
|
|
15
|
-
from cli.aikit.catalog import catalog_list, catalog_search, catalog_show
|
|
16
|
+
from cli.aikit.catalog import catalog_list, catalog_rebuild_index, catalog_search, catalog_show
|
|
16
17
|
from cli.aikit.cli_parser import DETERMINISTIC_COMMANDS, LLM_COMMANDS
|
|
17
18
|
from cli.aikit.contribution import (
|
|
18
19
|
contribution_checklist,
|
|
19
20
|
contribution_list,
|
|
20
21
|
contribution_prepare,
|
|
22
|
+
contribution_pr,
|
|
21
23
|
contribution_review,
|
|
22
24
|
contribution_validate,
|
|
23
25
|
)
|
|
@@ -43,6 +45,27 @@ from cli.aikit.extensions import (
|
|
|
43
45
|
)
|
|
44
46
|
from cli.aikit.github_pr import planned_pr_commands, pr_create_automation, pr_inspect, pr_list_review_requests, pr_review
|
|
45
47
|
from cli.aikit.install import InstallError, install_runtime
|
|
48
|
+
from cli.aikit.knowledge_base import (
|
|
49
|
+
knowledge_base_create,
|
|
50
|
+
knowledge_base_join,
|
|
51
|
+
knowledge_base_rotate_token,
|
|
52
|
+
knowledge_base_status,
|
|
53
|
+
knowledge_base_tokens,
|
|
54
|
+
knowledge_curate,
|
|
55
|
+
knowledge_doctor,
|
|
56
|
+
knowledge_index,
|
|
57
|
+
knowledge_init,
|
|
58
|
+
knowledge_publish,
|
|
59
|
+
knowledge_review,
|
|
60
|
+
knowledge_review_list,
|
|
61
|
+
knowledge_search,
|
|
62
|
+
knowledge_snapshot_list,
|
|
63
|
+
knowledge_snapshot_score,
|
|
64
|
+
knowledge_snapshot_create,
|
|
65
|
+
knowledge_snapshot_show,
|
|
66
|
+
knowledge_snapshot_submit,
|
|
67
|
+
knowledge_sync,
|
|
68
|
+
)
|
|
46
69
|
from cli.aikit.llm import (
|
|
47
70
|
configure_backend,
|
|
48
71
|
doctor_backends,
|
|
@@ -51,8 +74,45 @@ from cli.aikit.llm import (
|
|
|
51
74
|
set_default_backend,
|
|
52
75
|
set_llm_preference,
|
|
53
76
|
)
|
|
77
|
+
from cli.aikit.local_llm import (
|
|
78
|
+
local_llm_benchmark,
|
|
79
|
+
local_llm_doctor,
|
|
80
|
+
local_llm_install,
|
|
81
|
+
local_llm_list,
|
|
82
|
+
local_llm_models,
|
|
83
|
+
local_llm_remove,
|
|
84
|
+
)
|
|
85
|
+
from cli.aikit.local_artifacts import (
|
|
86
|
+
local_agent_create,
|
|
87
|
+
local_agent_list,
|
|
88
|
+
local_agent_show,
|
|
89
|
+
local_agent_validate,
|
|
90
|
+
local_automation_create,
|
|
91
|
+
local_automation_enable,
|
|
92
|
+
local_automation_list,
|
|
93
|
+
local_automation_remove,
|
|
94
|
+
local_automation_show,
|
|
95
|
+
local_automation_update,
|
|
96
|
+
local_automation_validate,
|
|
97
|
+
script_create,
|
|
98
|
+
script_list,
|
|
99
|
+
script_run,
|
|
100
|
+
skill_create,
|
|
101
|
+
skill_delete,
|
|
102
|
+
skill_list,
|
|
103
|
+
skill_show,
|
|
104
|
+
skill_update,
|
|
105
|
+
)
|
|
54
106
|
from cli.aikit.lock import parse_profiles
|
|
55
|
-
from cli.aikit.memory import
|
|
107
|
+
from cli.aikit.memory import (
|
|
108
|
+
create_memory_backup,
|
|
109
|
+
delete_memory_backup,
|
|
110
|
+
list_memory_backups,
|
|
111
|
+
memory_path_payload,
|
|
112
|
+
reset_memory,
|
|
113
|
+
restore_memory_backup,
|
|
114
|
+
show_memory,
|
|
115
|
+
)
|
|
56
116
|
from cli.aikit.mcp_manifest import mcp_doctor, mcp_manifest, mcp_tools_payload
|
|
57
117
|
from cli.aikit.mcp_server import serve_mcp_stdio
|
|
58
118
|
from cli.aikit.mini_brain import setup_mini_brain
|
|
@@ -66,6 +126,7 @@ from cli.aikit.notifications import (
|
|
|
66
126
|
send_notification_command,
|
|
67
127
|
)
|
|
68
128
|
from cli.aikit.ollama import ollama_models, ollama_pull, ollama_status, ollama_update
|
|
129
|
+
from cli.aikit.onboarding import onboarding_plan, onboarding_status
|
|
69
130
|
from cli.aikit.permissions import grant_permission, revoke_permission, show_permissions
|
|
70
131
|
from cli.aikit.personality import load_personality, reset_personality, setup_personality, update_personality
|
|
71
132
|
from cli.aikit.providers import (
|
|
@@ -89,6 +150,15 @@ from cli.aikit.secrets import (
|
|
|
89
150
|
secret_backends,
|
|
90
151
|
secrets_doctor,
|
|
91
152
|
)
|
|
153
|
+
from cli.aikit.shared_memory import (
|
|
154
|
+
shared_memory_create,
|
|
155
|
+
shared_memory_list,
|
|
156
|
+
shared_memory_publish,
|
|
157
|
+
shared_memory_read,
|
|
158
|
+
shared_memory_review,
|
|
159
|
+
shared_memory_status,
|
|
160
|
+
shared_memory_submit,
|
|
161
|
+
)
|
|
92
162
|
from cli.aikit.sources import SourceConfigBlockedError, SourceRegistryError, add_source, list_sources, remove_source, source_status
|
|
93
163
|
from cli.aikit.tasks import (
|
|
94
164
|
create_task,
|
|
@@ -100,6 +170,17 @@ from cli.aikit.tasks import (
|
|
|
100
170
|
update_task_schedule,
|
|
101
171
|
update_task_status,
|
|
102
172
|
)
|
|
173
|
+
from cli.aikit.team import (
|
|
174
|
+
team_doctor,
|
|
175
|
+
team_init,
|
|
176
|
+
team_onboard,
|
|
177
|
+
team_profile_export,
|
|
178
|
+
team_profile_import,
|
|
179
|
+
team_profile_list,
|
|
180
|
+
team_profile_show,
|
|
181
|
+
team_profile_use,
|
|
182
|
+
team_status,
|
|
183
|
+
)
|
|
103
184
|
from cli.aikit.toolchain import doctor_toolchain, install_toolchain, list_toolchain
|
|
104
185
|
from cli.aikit.workflows import workflow_install, workflow_list, workflow_run, workflow_show
|
|
105
186
|
from cli.aikit.wizard_state import WizardStateError, answer_wizard, cancel_wizard, list_wizards, show_wizard
|
|
@@ -120,16 +201,24 @@ def dispatch(args: argparse.Namespace) -> dict[str, Any] | None:
|
|
|
120
201
|
return run_agent_prompt(agent_prompt_request_from_args(args))
|
|
121
202
|
if command == "commands":
|
|
122
203
|
return list_command_modes()
|
|
204
|
+
if command == "onboard":
|
|
205
|
+
return dispatch_onboard(args)
|
|
123
206
|
if command == "architecture":
|
|
124
207
|
return architecture_contract(ROOT)
|
|
125
208
|
if command == "roadmap":
|
|
126
209
|
return dispatch_roadmap(args)
|
|
127
210
|
if command == "catalog":
|
|
128
211
|
return dispatch_catalog(args)
|
|
212
|
+
if command == "plan":
|
|
213
|
+
return dispatch_agentic_plan(args)
|
|
214
|
+
if command in {"execute", "orchestrate"}:
|
|
215
|
+
return dispatch_agentic_execute(command, args)
|
|
129
216
|
if command == "route":
|
|
130
217
|
return dispatch_route(args)
|
|
131
218
|
if command == "eval":
|
|
132
219
|
return dispatch_eval(args)
|
|
220
|
+
if command == "secret":
|
|
221
|
+
return dispatch_secret(args)
|
|
133
222
|
if command == "secrets":
|
|
134
223
|
return dispatch_secrets(args)
|
|
135
224
|
if command == "providers":
|
|
@@ -144,6 +233,8 @@ def dispatch(args: argparse.Namespace) -> dict[str, Any] | None:
|
|
|
144
233
|
return dispatch_wizard(args)
|
|
145
234
|
if command == "memory":
|
|
146
235
|
return dispatch_memory(args)
|
|
236
|
+
if command == "shared-memory":
|
|
237
|
+
return dispatch_shared_memory(args)
|
|
147
238
|
if command == "personality":
|
|
148
239
|
return dispatch_personality(args)
|
|
149
240
|
if command == "setup":
|
|
@@ -172,16 +263,28 @@ def dispatch(args: argparse.Namespace) -> dict[str, Any] | None:
|
|
|
172
263
|
return dispatch_config(args)
|
|
173
264
|
if command in {"tools", "integrations", "skills"}:
|
|
174
265
|
return dispatch_control_category(command, args)
|
|
266
|
+
if command == "skill":
|
|
267
|
+
return dispatch_skill(args)
|
|
268
|
+
if command == "script":
|
|
269
|
+
return dispatch_script(args)
|
|
175
270
|
if command == "decisions":
|
|
176
271
|
return dispatch_decisions(args)
|
|
177
272
|
if command == "ollama":
|
|
178
273
|
return dispatch_ollama(args)
|
|
274
|
+
if command == "local-llm":
|
|
275
|
+
return dispatch_local_llm(args)
|
|
179
276
|
if command == "mcp":
|
|
180
277
|
return dispatch_mcp(args)
|
|
181
278
|
if command == "local":
|
|
182
279
|
return dispatch_local(args)
|
|
183
280
|
if command == "workflow":
|
|
184
281
|
return dispatch_workflow(args)
|
|
282
|
+
if command == "team":
|
|
283
|
+
return dispatch_team(args)
|
|
284
|
+
if command == "knowledge":
|
|
285
|
+
return dispatch_knowledge(args)
|
|
286
|
+
if command == "knowledge-base":
|
|
287
|
+
return dispatch_knowledge_base(args)
|
|
185
288
|
if command in {"contribute", "contribution"}:
|
|
186
289
|
return dispatch_contribution(args)
|
|
187
290
|
if command == "llm":
|
|
@@ -255,15 +358,47 @@ def list_command_modes() -> dict[str, Any]:
|
|
|
255
358
|
for command in DETERMINISTIC_COMMANDS
|
|
256
359
|
],
|
|
257
360
|
"llm": [
|
|
258
|
-
|
|
259
|
-
"command": command,
|
|
260
|
-
"requires_llm": True,
|
|
261
|
-
}
|
|
361
|
+
llm_command_mode(command)
|
|
262
362
|
for command in LLM_COMMANDS
|
|
263
363
|
],
|
|
264
364
|
}
|
|
265
365
|
|
|
266
366
|
|
|
367
|
+
def llm_command_mode(command: str) -> dict[str, Any]:
|
|
368
|
+
if command == "agent":
|
|
369
|
+
return {
|
|
370
|
+
"command": command,
|
|
371
|
+
"requires_llm": False,
|
|
372
|
+
"mode": "adaptive",
|
|
373
|
+
"uses_llm_when_needed": True,
|
|
374
|
+
"local_without_llm": [
|
|
375
|
+
"onboarding",
|
|
376
|
+
"identity",
|
|
377
|
+
"rename",
|
|
378
|
+
"capabilities-help",
|
|
379
|
+
"deterministic-routing",
|
|
380
|
+
],
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
383
|
+
"command": command,
|
|
384
|
+
"requires_llm": True,
|
|
385
|
+
"mode": "llm",
|
|
386
|
+
"uses_llm_when_needed": True,
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def dispatch_onboard(args: argparse.Namespace) -> dict[str, Any]:
|
|
391
|
+
action = getattr(args, "action", "show")
|
|
392
|
+
if action in {"minimal", "complete"}:
|
|
393
|
+
try:
|
|
394
|
+
return onboarding_plan(ROOT, action)
|
|
395
|
+
except ValueError as exc:
|
|
396
|
+
raise DevKitError(str(exc)) from exc
|
|
397
|
+
if action != "show":
|
|
398
|
+
raise DevKitError(f"unsupported onboard action: {args.action}")
|
|
399
|
+
return onboarding_status(ROOT)
|
|
400
|
+
|
|
401
|
+
|
|
267
402
|
def dispatch_roadmap(args: argparse.Namespace) -> dict[str, Any]:
|
|
268
403
|
if args.action == "show":
|
|
269
404
|
if args.target:
|
|
@@ -278,17 +413,57 @@ def dispatch_roadmap(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
278
413
|
|
|
279
414
|
|
|
280
415
|
def dispatch_catalog(args: argparse.Namespace) -> dict[str, Any]:
|
|
416
|
+
filters = catalog_filters_from_args(args)
|
|
281
417
|
if args.action == "list":
|
|
282
|
-
if args.query:
|
|
418
|
+
if args.query or getattr(args, "target", None):
|
|
283
419
|
raise DevKitError("catalog list does not accept a query")
|
|
284
|
-
return catalog_list(ROOT)
|
|
420
|
+
return catalog_list(ROOT, item_type=args.item_type, filters=filters)
|
|
285
421
|
if args.action == "search":
|
|
286
|
-
|
|
422
|
+
if getattr(args, "target", None):
|
|
423
|
+
raise DevKitError("catalog search does not accept a second query")
|
|
424
|
+
return catalog_search(args.query or "", ROOT, item_type=args.item_type, filters=filters)
|
|
287
425
|
if args.action == "show":
|
|
288
|
-
|
|
426
|
+
if getattr(args, "target", None):
|
|
427
|
+
raise DevKitError("catalog show accepts only one item id")
|
|
428
|
+
return catalog_show(args.query or "", ROOT, item_type=args.item_type)
|
|
429
|
+
if args.action == "inspect":
|
|
430
|
+
if not args.query or not args.target:
|
|
431
|
+
raise DevKitError("catalog inspect requires <type> <id>")
|
|
432
|
+
return catalog_show(args.target, ROOT, item_type=args.query)
|
|
433
|
+
if args.action == "rebuild-index":
|
|
434
|
+
if args.query or getattr(args, "target", None):
|
|
435
|
+
raise DevKitError("catalog rebuild-index does not accept arguments")
|
|
436
|
+
return catalog_rebuild_index(ROOT)
|
|
289
437
|
raise DevKitError(f"unsupported catalog action: {args.action}")
|
|
290
438
|
|
|
291
439
|
|
|
440
|
+
def dispatch_agentic_plan(args: argparse.Namespace) -> dict[str, Any]:
|
|
441
|
+
return agentic_plan(ROOT, list(getattr(args, "prompt", []) or []))
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def dispatch_agentic_execute(command: str, args: argparse.Namespace) -> dict[str, Any]:
|
|
445
|
+
return agentic_execute(
|
|
446
|
+
list(getattr(args, "prompt", []) or []),
|
|
447
|
+
llm=getattr(args, "llm", None),
|
|
448
|
+
dry_run=effective_dry_run(args),
|
|
449
|
+
session_id=getattr(args, "session_id", None),
|
|
450
|
+
new_session=bool(getattr(args, "new_session", False)),
|
|
451
|
+
no_llm_fallback=bool(getattr(args, "no_llm_fallback", False)),
|
|
452
|
+
prog_name=getattr(args, "prog_name", "agent"),
|
|
453
|
+
project=str(Path.cwd()),
|
|
454
|
+
mode=command,
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
def catalog_filters_from_args(args: argparse.Namespace) -> dict[str, Any]:
|
|
459
|
+
return {
|
|
460
|
+
"provider": getattr(args, "provider", None),
|
|
461
|
+
"status": getattr(args, "status", None),
|
|
462
|
+
"write_policy": getattr(args, "write_policy", None),
|
|
463
|
+
"readiness": getattr(args, "readiness", None),
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
|
|
292
467
|
def dispatch_route(args: argparse.Namespace) -> dict[str, Any]:
|
|
293
468
|
prompt = " ".join(args.prompt or []).strip()
|
|
294
469
|
if not prompt:
|
|
@@ -305,9 +480,7 @@ def dispatch_eval(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
305
480
|
if args.action == "run":
|
|
306
481
|
return eval_run(args.suite or "all", ROOT)
|
|
307
482
|
if args.action == "report":
|
|
308
|
-
|
|
309
|
-
raise DevKitError("eval report does not accept a suite")
|
|
310
|
-
return eval_report()
|
|
483
|
+
return eval_report(args.suite)
|
|
311
484
|
except ValueError as exc:
|
|
312
485
|
raise DevKitError(str(exc)) from exc
|
|
313
486
|
raise DevKitError(f"unsupported eval action: {args.action}")
|
|
@@ -333,6 +506,40 @@ def dispatch_secrets(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
333
506
|
raise DevKitError(f"unsupported secrets action: {args.action}")
|
|
334
507
|
|
|
335
508
|
|
|
509
|
+
def dispatch_secret(args: argparse.Namespace) -> dict[str, Any]:
|
|
510
|
+
if args.action == "doctor":
|
|
511
|
+
return secrets_doctor()
|
|
512
|
+
if args.action == "list":
|
|
513
|
+
return list_secret_references()
|
|
514
|
+
if args.action == "set":
|
|
515
|
+
if not args.provider or not args.key:
|
|
516
|
+
raise DevKitError("secret set requires <provider> <key>")
|
|
517
|
+
return add_secret_reference(args.provider, args.key, env=args.env)
|
|
518
|
+
if args.action == "get":
|
|
519
|
+
provider, key = secret_ref_parts(args.secret_ref, args.provider, args.key)
|
|
520
|
+
payload = list_secret_references()
|
|
521
|
+
for item in payload.get("references") or []:
|
|
522
|
+
if item.get("provider") == provider and item.get("key") == key:
|
|
523
|
+
return {"kind": "secret-reference", "status": "found", "reference": item, "value_returned": False}
|
|
524
|
+
return {"kind": "secret-reference", "status": "not-found", "reference": {"provider": provider, "key": key}, "value_returned": False}
|
|
525
|
+
if args.action == "delete":
|
|
526
|
+
provider, key = secret_ref_parts(args.secret_ref, args.provider, args.key)
|
|
527
|
+
return remove_secret_reference(provider, key)
|
|
528
|
+
raise DevKitError(f"unsupported secret action: {args.action}")
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
def secret_ref_parts(secret_ref: str | None, provider: str | None, key: str | None) -> tuple[str, str]:
|
|
532
|
+
if secret_ref:
|
|
533
|
+
normalized = secret_ref.removeprefix("secret:").replace("/", ".")
|
|
534
|
+
parts = [part for part in normalized.split(".") if part]
|
|
535
|
+
if len(parts) >= 2:
|
|
536
|
+
return parts[0], ".".join(parts[1:])
|
|
537
|
+
raise DevKitError("--ref must use provider.key or secret:provider.key")
|
|
538
|
+
if not provider or not key:
|
|
539
|
+
raise DevKitError("secret reference requires <provider> <key> or --ref provider.key")
|
|
540
|
+
return provider, key
|
|
541
|
+
|
|
542
|
+
|
|
336
543
|
def dispatch_agents(args: argparse.Namespace) -> dict[str, Any]:
|
|
337
544
|
if args.action == "list":
|
|
338
545
|
if args.query:
|
|
@@ -342,6 +549,12 @@ def dispatch_agents(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
342
549
|
return catalog_search(args.query or "", ROOT, item_type="agent")
|
|
343
550
|
if args.action == "show":
|
|
344
551
|
return catalog_show(args.query or "", ROOT, item_type="agent")
|
|
552
|
+
if args.action == "create":
|
|
553
|
+
return local_agent_create(args.query, description=args.description, force=args.force)
|
|
554
|
+
if args.action == "validate":
|
|
555
|
+
return local_agent_validate(args.query)
|
|
556
|
+
if args.action == "local-list":
|
|
557
|
+
return local_agent_list()
|
|
345
558
|
raise DevKitError(f"unsupported agents action: {args.action}")
|
|
346
559
|
|
|
347
560
|
|
|
@@ -365,6 +578,25 @@ def dispatch_capabilities(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
365
578
|
|
|
366
579
|
|
|
367
580
|
def dispatch_local(args: argparse.Namespace) -> dict[str, Any]:
|
|
581
|
+
if args.action == "automation":
|
|
582
|
+
return dispatch_local_automation(args)
|
|
583
|
+
if args.action == "agents":
|
|
584
|
+
if args.extension_id:
|
|
585
|
+
raise DevKitError("local agents does not accept an argument")
|
|
586
|
+
return local_agent_list()
|
|
587
|
+
if args.action == "agent":
|
|
588
|
+
action = args.extension_id or "list"
|
|
589
|
+
if action == "list":
|
|
590
|
+
if args.local_item_id:
|
|
591
|
+
raise DevKitError("local agent list does not accept an agent id")
|
|
592
|
+
return local_agent_list()
|
|
593
|
+
if action == "create":
|
|
594
|
+
return local_agent_create(args.local_item_id, description=args.title or args.prompt, force=args.force)
|
|
595
|
+
if action == "show":
|
|
596
|
+
return local_agent_show(args.local_item_id)
|
|
597
|
+
if action == "validate":
|
|
598
|
+
return local_agent_validate(args.local_item_id)
|
|
599
|
+
raise DevKitError(f"unsupported local agent action: {action}")
|
|
368
600
|
if args.action == "list":
|
|
369
601
|
if args.extension_id:
|
|
370
602
|
raise DevKitError("local list does not accept an extension id")
|
|
@@ -386,6 +618,73 @@ def dispatch_local(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
386
618
|
raise DevKitError(f"unsupported local action: {args.action}")
|
|
387
619
|
|
|
388
620
|
|
|
621
|
+
def dispatch_local_automation(args: argparse.Namespace) -> dict[str, Any]:
|
|
622
|
+
action = args.extension_id or "list"
|
|
623
|
+
automation_id = args.local_item_id
|
|
624
|
+
if action == "list":
|
|
625
|
+
if automation_id:
|
|
626
|
+
raise DevKitError("local automation list does not accept an automation id")
|
|
627
|
+
return local_automation_list()
|
|
628
|
+
if action == "create":
|
|
629
|
+
return local_automation_create(
|
|
630
|
+
automation_id,
|
|
631
|
+
title=args.title,
|
|
632
|
+
prompt=args.prompt,
|
|
633
|
+
command=args.local_command,
|
|
634
|
+
every=args.every,
|
|
635
|
+
cron=args.cron,
|
|
636
|
+
force=args.force,
|
|
637
|
+
)
|
|
638
|
+
if action == "show":
|
|
639
|
+
return local_automation_show(automation_id)
|
|
640
|
+
if action == "update":
|
|
641
|
+
return local_automation_update(
|
|
642
|
+
automation_id,
|
|
643
|
+
title=args.title,
|
|
644
|
+
prompt=args.prompt,
|
|
645
|
+
command=args.local_command,
|
|
646
|
+
every=args.every,
|
|
647
|
+
cron=args.cron,
|
|
648
|
+
)
|
|
649
|
+
if action == "enable":
|
|
650
|
+
return local_automation_enable(automation_id, True)
|
|
651
|
+
if action == "disable":
|
|
652
|
+
return local_automation_enable(automation_id, False)
|
|
653
|
+
if action in {"remove", "delete"}:
|
|
654
|
+
return local_automation_remove(automation_id, yes=args.yes)
|
|
655
|
+
if action == "validate":
|
|
656
|
+
return local_automation_validate(automation_id)
|
|
657
|
+
raise DevKitError(f"unsupported local automation action: {action}")
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
def dispatch_skill(args: argparse.Namespace) -> dict[str, Any]:
|
|
661
|
+
if args.action == "create":
|
|
662
|
+
return skill_create(args.skill_id, description=args.description, force=args.force)
|
|
663
|
+
if args.action == "list":
|
|
664
|
+
if args.skill_id:
|
|
665
|
+
raise DevKitError("skill list does not accept a skill id")
|
|
666
|
+
return skill_list()
|
|
667
|
+
if args.action == "show":
|
|
668
|
+
return skill_show(args.skill_id)
|
|
669
|
+
if args.action == "update":
|
|
670
|
+
return skill_update(args.skill_id, description=args.description)
|
|
671
|
+
if args.action == "delete":
|
|
672
|
+
return skill_delete(args.skill_id, yes=args.yes)
|
|
673
|
+
raise DevKitError(f"unsupported skill action: {args.action}")
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
def dispatch_script(args: argparse.Namespace) -> dict[str, Any]:
|
|
677
|
+
if args.action == "create":
|
|
678
|
+
return script_create(args.script_id, command=args.script_command, force=args.force)
|
|
679
|
+
if args.action == "list":
|
|
680
|
+
if args.script_id:
|
|
681
|
+
raise DevKitError("script list does not accept a script id")
|
|
682
|
+
return script_list()
|
|
683
|
+
if args.action == "run":
|
|
684
|
+
return script_run(args.script_id, dry_run=effective_dry_run(args), yes=args.yes)
|
|
685
|
+
raise DevKitError(f"unsupported script action: {args.action}")
|
|
686
|
+
|
|
687
|
+
|
|
389
688
|
def dispatch_workflow(args: argparse.Namespace) -> dict[str, Any]:
|
|
390
689
|
try:
|
|
391
690
|
if args.action == "list":
|
|
@@ -404,6 +703,94 @@ def dispatch_workflow(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
404
703
|
raise DevKitError(f"unsupported workflow action: {args.action}")
|
|
405
704
|
|
|
406
705
|
|
|
706
|
+
def dispatch_team(args: argparse.Namespace) -> dict[str, Any]:
|
|
707
|
+
project = Path.cwd()
|
|
708
|
+
if args.action == "init":
|
|
709
|
+
return team_init(project, force=args.force)
|
|
710
|
+
if args.action == "status":
|
|
711
|
+
return team_status(project)
|
|
712
|
+
if args.action == "doctor":
|
|
713
|
+
return team_doctor(project)
|
|
714
|
+
if args.action == "onboard":
|
|
715
|
+
return team_onboard(project)
|
|
716
|
+
if args.action == "profile":
|
|
717
|
+
action = args.profile_action or "list"
|
|
718
|
+
if action == "list":
|
|
719
|
+
return team_profile_list(project)
|
|
720
|
+
if action == "show":
|
|
721
|
+
return team_profile_show(args.profile_id, project)
|
|
722
|
+
if action == "use":
|
|
723
|
+
return team_profile_use(args.profile_id, project)
|
|
724
|
+
if action == "export":
|
|
725
|
+
return team_profile_export(args.profile_id, args.profile_path, project)
|
|
726
|
+
if action == "import":
|
|
727
|
+
return team_profile_import(args.profile_path or args.profile_id, project)
|
|
728
|
+
raise DevKitError(f"unsupported team profile action: {action}")
|
|
729
|
+
raise DevKitError(f"unsupported team action: {args.action}")
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
def dispatch_knowledge(args: argparse.Namespace) -> dict[str, Any]:
|
|
733
|
+
project = Path.cwd()
|
|
734
|
+
if args.action == "init":
|
|
735
|
+
return knowledge_init(project, force=args.force)
|
|
736
|
+
if args.action == "doctor":
|
|
737
|
+
return knowledge_doctor(project)
|
|
738
|
+
if args.action == "search":
|
|
739
|
+
return knowledge_search(args.target, project)
|
|
740
|
+
if args.action in {"index", "reindex"}:
|
|
741
|
+
return knowledge_index(project)
|
|
742
|
+
if args.action == "snapshot":
|
|
743
|
+
snapshot_action = args.target or "list"
|
|
744
|
+
snapshot_target = args.snapshot_action
|
|
745
|
+
if not snapshot_action or snapshot_action == "list":
|
|
746
|
+
if snapshot_target:
|
|
747
|
+
raise DevKitError("knowledge snapshot list does not accept a snapshot id")
|
|
748
|
+
return knowledge_snapshot_list(project)
|
|
749
|
+
if snapshot_action == "create":
|
|
750
|
+
if snapshot_target:
|
|
751
|
+
raise DevKitError("knowledge snapshot create does not accept a positional snapshot id")
|
|
752
|
+
return knowledge_snapshot_create(
|
|
753
|
+
title=args.title,
|
|
754
|
+
content=args.content,
|
|
755
|
+
from_file=args.from_file,
|
|
756
|
+
entry_type=args.entry_type,
|
|
757
|
+
project=project,
|
|
758
|
+
)
|
|
759
|
+
if snapshot_action == "show":
|
|
760
|
+
return knowledge_snapshot_show(snapshot_target, project)
|
|
761
|
+
if snapshot_action == "score":
|
|
762
|
+
return knowledge_snapshot_score(snapshot_target, project)
|
|
763
|
+
if snapshot_action == "submit":
|
|
764
|
+
return knowledge_snapshot_submit(snapshot_target, project)
|
|
765
|
+
raise DevKitError("knowledge snapshot action must be create, list, show, score or submit")
|
|
766
|
+
if args.action == "review":
|
|
767
|
+
if args.target == "list" or not args.target:
|
|
768
|
+
return knowledge_review_list(project)
|
|
769
|
+
return knowledge_review(args.target, project)
|
|
770
|
+
if args.action == "curate":
|
|
771
|
+
return knowledge_curate(project)
|
|
772
|
+
if args.action == "publish":
|
|
773
|
+
return knowledge_publish(args.target, project, yes=args.yes, owner_agent=args.owner_agent)
|
|
774
|
+
if args.action == "sync":
|
|
775
|
+
return knowledge_sync(project)
|
|
776
|
+
raise DevKitError(f"unsupported knowledge action: {args.action}")
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
def dispatch_knowledge_base(args: argparse.Namespace) -> dict[str, Any]:
|
|
780
|
+
project = Path.cwd()
|
|
781
|
+
if args.action == "create":
|
|
782
|
+
return knowledge_base_create(project, provider=args.provider, force=args.force)
|
|
783
|
+
if args.action == "join":
|
|
784
|
+
return knowledge_base_join(args.target, project, provider=args.provider, force=args.force)
|
|
785
|
+
if args.action == "status":
|
|
786
|
+
return knowledge_base_status(project)
|
|
787
|
+
if args.action == "tokens":
|
|
788
|
+
return knowledge_base_tokens(project)
|
|
789
|
+
if args.action == "rotate-token":
|
|
790
|
+
return knowledge_base_rotate_token(args.target, project)
|
|
791
|
+
raise DevKitError(f"unsupported knowledge-base action: {args.action}")
|
|
792
|
+
|
|
793
|
+
|
|
407
794
|
def dispatch_contribution(args: argparse.Namespace) -> dict[str, Any]:
|
|
408
795
|
if args.action == "list":
|
|
409
796
|
if args.extension_id:
|
|
@@ -412,6 +799,8 @@ def dispatch_contribution(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
412
799
|
require_id(args.extension_id, f"{args.command} {args.action}")
|
|
413
800
|
if args.action == "prepare":
|
|
414
801
|
return contribution_prepare(args.extension_id)
|
|
802
|
+
if args.action == "pr":
|
|
803
|
+
return contribution_pr(args.extension_id, dry_run=effective_dry_run(args) or not args.yes, yes=args.yes)
|
|
415
804
|
if args.action == "validate":
|
|
416
805
|
return contribution_validate(args.extension_id)
|
|
417
806
|
if args.action == "review":
|
|
@@ -609,6 +998,28 @@ def dispatch_ollama(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
609
998
|
raise DevKitError(f"unsupported ollama action: {args.action}")
|
|
610
999
|
|
|
611
1000
|
|
|
1001
|
+
def dispatch_local_llm(args: argparse.Namespace) -> dict[str, Any]:
|
|
1002
|
+
if args.action == "list":
|
|
1003
|
+
if args.model:
|
|
1004
|
+
raise DevKitError("local-llm list does not accept a model")
|
|
1005
|
+
return local_llm_list()
|
|
1006
|
+
if args.action == "doctor":
|
|
1007
|
+
if args.model:
|
|
1008
|
+
raise DevKitError("local-llm doctor does not accept a model")
|
|
1009
|
+
return local_llm_doctor()
|
|
1010
|
+
if args.action == "models":
|
|
1011
|
+
if args.model:
|
|
1012
|
+
raise DevKitError("local-llm models does not accept a model")
|
|
1013
|
+
return local_llm_models()
|
|
1014
|
+
if args.action == "install":
|
|
1015
|
+
return local_llm_install(args.model, dry_run=effective_dry_run(args), yes=args.yes)
|
|
1016
|
+
if args.action == "remove":
|
|
1017
|
+
return local_llm_remove(args.model, dry_run=effective_dry_run(args), yes=args.yes)
|
|
1018
|
+
if args.action == "benchmark":
|
|
1019
|
+
return local_llm_benchmark(args.model)
|
|
1020
|
+
raise DevKitError(f"unsupported local-llm action: {args.action}")
|
|
1021
|
+
|
|
1022
|
+
|
|
612
1023
|
def dispatch_install(args: argparse.Namespace) -> dict[str, Any]:
|
|
613
1024
|
try:
|
|
614
1025
|
return install_runtime(
|
|
@@ -744,6 +1155,53 @@ def dispatch_memory(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
744
1155
|
return show_memory(ROOT, agent_id=args.agent_id, source_id=args.source_id)
|
|
745
1156
|
if args.action == "path":
|
|
746
1157
|
return memory_path_payload()
|
|
1158
|
+
if args.action == "backup":
|
|
1159
|
+
backup_action = args.memory_id or "list"
|
|
1160
|
+
if backup_action in {"list", "show"}:
|
|
1161
|
+
if args.submission_id:
|
|
1162
|
+
raise DevKitError("memory backup list does not accept a backup id")
|
|
1163
|
+
return list_memory_backups()
|
|
1164
|
+
if backup_action == "create":
|
|
1165
|
+
if args.submission_id:
|
|
1166
|
+
raise DevKitError("memory backup create does not accept a backup id")
|
|
1167
|
+
try:
|
|
1168
|
+
return create_memory_backup(
|
|
1169
|
+
title=args.title,
|
|
1170
|
+
encrypted=args.encrypted,
|
|
1171
|
+
passphrase_env=args.passphrase_env,
|
|
1172
|
+
)
|
|
1173
|
+
except ValueError as exc:
|
|
1174
|
+
raise DevKitError(str(exc)) from exc
|
|
1175
|
+
if backup_action == "restore":
|
|
1176
|
+
try:
|
|
1177
|
+
if not args.submission_id and not args.backup_file:
|
|
1178
|
+
raise ValueError("memory backup restore requires a backup id or --file")
|
|
1179
|
+
return restore_memory_backup(
|
|
1180
|
+
args.submission_id,
|
|
1181
|
+
yes=args.yes,
|
|
1182
|
+
backup_file=args.backup_file,
|
|
1183
|
+
passphrase_env=args.passphrase_env,
|
|
1184
|
+
)
|
|
1185
|
+
except ValueError as exc:
|
|
1186
|
+
raise DevKitError(str(exc)) from exc
|
|
1187
|
+
if backup_action == "delete":
|
|
1188
|
+
try:
|
|
1189
|
+
return delete_memory_backup(args.submission_id, yes=args.yes)
|
|
1190
|
+
except ValueError as exc:
|
|
1191
|
+
raise DevKitError(str(exc)) from exc
|
|
1192
|
+
raise DevKitError("memory backup action must be create, list, restore or delete")
|
|
1193
|
+
if args.action in {"share", "shared"}:
|
|
1194
|
+
if args.memory_id:
|
|
1195
|
+
return shared_memory_status(args.memory_id)
|
|
1196
|
+
return shared_memory_create(args.title)
|
|
1197
|
+
if args.action == "read":
|
|
1198
|
+
return shared_memory_read(args.memory_id, args.submission_id, contributor_key=args.contributor_key)
|
|
1199
|
+
if args.action == "submit":
|
|
1200
|
+
return shared_memory_submit(args.memory_id, title=args.title, content=args.content, contributor_key=args.contributor_key)
|
|
1201
|
+
if args.action == "review":
|
|
1202
|
+
return shared_memory_review(args.memory_id, args.submission_id)
|
|
1203
|
+
if args.action == "publish":
|
|
1204
|
+
return shared_memory_publish(args.memory_id, args.submission_id, yes=args.yes, owner_key=getattr(args, "owner_key", None))
|
|
747
1205
|
if args.action == "reset":
|
|
748
1206
|
return reset_memory(
|
|
749
1207
|
all_memory=args.all,
|
|
@@ -756,6 +1214,24 @@ def dispatch_memory(args: argparse.Namespace) -> dict[str, Any]:
|
|
|
756
1214
|
raise DevKitError(f"unsupported memory action: {args.action}")
|
|
757
1215
|
|
|
758
1216
|
|
|
1217
|
+
def dispatch_shared_memory(args: argparse.Namespace) -> dict[str, Any]:
|
|
1218
|
+
if args.action == "create":
|
|
1219
|
+
return shared_memory_create(args.title)
|
|
1220
|
+
if args.action == "list":
|
|
1221
|
+
return shared_memory_list()
|
|
1222
|
+
if args.action == "status":
|
|
1223
|
+
return shared_memory_status(args.memory_id)
|
|
1224
|
+
if args.action == "read":
|
|
1225
|
+
return shared_memory_read(args.memory_id, args.submission_id, contributor_key=args.contributor_key)
|
|
1226
|
+
if args.action == "submit":
|
|
1227
|
+
return shared_memory_submit(args.memory_id, title=args.title, content=args.content, contributor_key=args.contributor_key)
|
|
1228
|
+
if args.action == "review":
|
|
1229
|
+
return shared_memory_review(args.memory_id, args.submission_id)
|
|
1230
|
+
if args.action == "publish":
|
|
1231
|
+
return shared_memory_publish(args.memory_id, args.submission_id, yes=args.yes, owner_key=args.owner_key)
|
|
1232
|
+
raise DevKitError(f"unsupported shared-memory action: {args.action}")
|
|
1233
|
+
|
|
1234
|
+
|
|
759
1235
|
def dispatch_personality(args: argparse.Namespace) -> dict[str, Any]:
|
|
760
1236
|
if args.action == "show":
|
|
761
1237
|
return load_personality()
|