keystone-cli 0.1.0__tar.gz → 0.1.9__tar.gz
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.
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/PKG-INFO +2 -2
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/pyproject.toml +2 -2
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/__main__.py +29 -0
- keystone_cli-0.1.9/src/keystone_cli/_build_env.py +2 -0
- keystone_cli-0.1.9/src/keystone_cli/_version.py +41 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/auth/token_store.py +45 -8
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/commands/agent.py +633 -6
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/commands/login.py +17 -2
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/scaffold.py +1 -1
- keystone_cli-0.1.9/src/keystone_cli/templates/memory/README.md.tmpl +33 -0
- keystone_cli-0.1.9/src/keystone_cli/templates/memory/agent.yaml.tmpl +21 -0
- keystone_cli-0.1.9/src/keystone_cli/templates/memory/pkg/graph.py.tmpl +66 -0
- keystone_cli-0.1.9/src/keystone_cli/templates/rag-qa/pyproject.toml.tmpl +12 -0
- keystone_cli-0.1.9/src/keystone_cli/templates/tool-agent/env.tmpl +10 -0
- keystone_cli-0.1.9/src/keystone_cli/templates/tool-agent/gitignore.tmpl +7 -0
- keystone_cli-0.1.9/src/keystone_cli/templates/tool-agent/pkg/__init__.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli.egg-info/PKG-INFO +2 -2
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli.egg-info/SOURCES.txt +13 -0
- keystone_cli-0.1.9/tests/test_build_progress.py +37 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_deploy.py +90 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_init.py +1 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_invoke.py +89 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_login_command.py +40 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_status.py +52 -0
- keystone_cli-0.1.9/tests/test_threads.py +241 -0
- keystone_cli-0.1.9/tests/test_traces.py +184 -0
- keystone_cli-0.1.9/tests/test_version.py +83 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/setup.cfg +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/__init__.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/auth/__init__.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/auth/device_flow.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/commands/__init__.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/commands/dev.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/commands/workspace.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/devloop.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/platform_client.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/runner.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/blank/README.md.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/blank/agent.yaml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/blank/env.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/blank/gitignore.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/blank/pkg/__init__.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/blank/pkg/graph.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/blank/pyproject.toml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/hitl/README.md.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/hitl/agent.yaml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/hitl/env.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/hitl/gitignore.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/hitl/pkg/__init__.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/hitl/pkg/graph.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/hitl/pyproject.toml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/llm/README.md.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/llm/agent.yaml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/llm/env.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/llm/gitignore.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/llm/pkg/__init__.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/llm/pkg/graph.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/llm/pyproject.toml.tmpl +0 -0
- {keystone_cli-0.1.0/src/keystone_cli/templates/rag-qa → keystone_cli-0.1.9/src/keystone_cli/templates/memory}/env.tmpl +0 -0
- {keystone_cli-0.1.0/src/keystone_cli/templates/rag-qa → keystone_cli-0.1.9/src/keystone_cli/templates/memory}/gitignore.tmpl +0 -0
- {keystone_cli-0.1.0/src/keystone_cli/templates/rag-qa → keystone_cli-0.1.9/src/keystone_cli/templates/memory}/pkg/__init__.py.tmpl +0 -0
- {keystone_cli-0.1.0/src/keystone_cli/templates/rag-qa → keystone_cli-0.1.9/src/keystone_cli/templates/memory}/pyproject.toml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/rag-qa/README.md.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/rag-qa/agent.yaml.tmpl +0 -0
- {keystone_cli-0.1.0/src/keystone_cli/templates/tool-agent → keystone_cli-0.1.9/src/keystone_cli/templates/rag-qa}/env.tmpl +0 -0
- {keystone_cli-0.1.0/src/keystone_cli/templates/tool-agent → keystone_cli-0.1.9/src/keystone_cli/templates/rag-qa}/gitignore.tmpl +0 -0
- {keystone_cli-0.1.0/src/keystone_cli/templates/tool-agent → keystone_cli-0.1.9/src/keystone_cli/templates/rag-qa}/pkg/__init__.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/rag-qa/pkg/graph.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/tool-agent/README.md.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/tool-agent/agent.yaml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/tool-agent/pkg/graph.py.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli/templates/tool-agent/pyproject.toml.tmpl +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli.egg-info/dependency_links.txt +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli.egg-info/entry_points.txt +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli.egg-info/requires.txt +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/src/keystone_cli.egg-info/top_level.txt +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_agent.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_auth.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_ci_token.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_dev.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_offline.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_platform_client.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_publish.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_retire_delete.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_runs.py +0 -0
- {keystone_cli-0.1.0 → keystone_cli-0.1.9}/tests/test_workspace.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: keystone-cli
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: Keystone pro-code agent CLI — validate
|
|
3
|
+
Version: 0.1.9
|
|
4
|
+
Summary: Keystone pro-code agent CLI — author, validate, and run agents locally, then deploy and invoke them on the Keystone platform.
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Requires-Dist: keystone-agent-sdk<0.4,>=0.3
|
|
7
7
|
Requires-Dist: keystone-request-context<0.4,>=0.3
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "keystone-cli"
|
|
7
|
-
version = "0.1.
|
|
8
|
-
description = "Keystone pro-code agent CLI — validate
|
|
7
|
+
version = "0.1.9"
|
|
8
|
+
description = "Keystone pro-code agent CLI — author, validate, and run agents locally, then deploy and invoke them on the Keystone platform."
|
|
9
9
|
requires-python = ">=3.12"
|
|
10
10
|
dependencies = [
|
|
11
11
|
# Pinned to a compatible range: on an index (Artifact Registry) an unpinned name resolves to
|
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import typer
|
|
6
6
|
|
|
7
|
+
from keystone_cli._version import version_line
|
|
7
8
|
from keystone_cli.commands.agent import agent_app
|
|
8
9
|
from keystone_cli.commands.dev import dev
|
|
9
10
|
from keystone_cli.commands.login import login
|
|
@@ -14,6 +15,34 @@ app = typer.Typer(
|
|
|
14
15
|
no_args_is_help=True,
|
|
15
16
|
add_completion=False,
|
|
16
17
|
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _version_callback(value: bool) -> None:
|
|
21
|
+
if value:
|
|
22
|
+
typer.echo(version_line())
|
|
23
|
+
raise typer.Exit()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@app.callback()
|
|
27
|
+
def _main(
|
|
28
|
+
_version: bool = typer.Option(
|
|
29
|
+
False,
|
|
30
|
+
"--version",
|
|
31
|
+
"-V",
|
|
32
|
+
callback=_version_callback,
|
|
33
|
+
is_eager=True,
|
|
34
|
+
help="Show the CLI version (and target env) and exit.",
|
|
35
|
+
),
|
|
36
|
+
) -> None:
|
|
37
|
+
"""Keystone pro-code agent CLI."""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@app.command(name="version")
|
|
41
|
+
def version() -> None:
|
|
42
|
+
"""Show the CLI version, its target env, and the bundled agent-sdk version."""
|
|
43
|
+
typer.echo(version_line())
|
|
44
|
+
|
|
45
|
+
|
|
17
46
|
app.add_typer(agent_app, name="agent")
|
|
18
47
|
app.add_typer(workspace_app, name="workspace")
|
|
19
48
|
app.command(name="login")(login)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""CLI version reporting.
|
|
2
|
+
|
|
3
|
+
The distribution NAME is per-env suffixed by CI (`keystone-cli-dev`, `-qc`,
|
|
4
|
+
`-staging`); prod ships the bare `keystone-cli`, and a source/editable install
|
|
5
|
+
is also the bare name with ``BUILD_ENV`` defaulting to ``dev``. So probe the
|
|
6
|
+
env-specific name first and fall back to the bare name — that resolves the
|
|
7
|
+
version for every install shape without knowing which one we are.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from importlib.metadata import PackageNotFoundError
|
|
13
|
+
from importlib.metadata import version as _dist_version
|
|
14
|
+
|
|
15
|
+
from keystone_cli._build_env import BUILD_ENV
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _resolve(base: str) -> str:
|
|
19
|
+
names = [base] if BUILD_ENV == "prod" else [f"{base}-{BUILD_ENV}", base]
|
|
20
|
+
for name in names:
|
|
21
|
+
try:
|
|
22
|
+
return _dist_version(name)
|
|
23
|
+
except PackageNotFoundError:
|
|
24
|
+
continue
|
|
25
|
+
return "unknown"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def cli_version() -> str:
|
|
29
|
+
"""Installed keystone-cli version, or ``unknown`` if not resolvable."""
|
|
30
|
+
return _resolve("keystone-cli")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def sdk_version() -> str:
|
|
34
|
+
"""Installed keystone-agent-sdk version (bundles the deploy archive) — shown
|
|
35
|
+
so a bundle-behaviour bug can be pinned to a lib version at a glance."""
|
|
36
|
+
return _resolve("keystone-agent-sdk")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def version_line() -> str:
|
|
40
|
+
"""One-line version banner: ``keystone <ver> (env: <env>) · agent-sdk <ver>``."""
|
|
41
|
+
return f"keystone {cli_version()} (env: {BUILD_ENV}) · agent-sdk {sdk_version()}"
|
|
@@ -12,14 +12,46 @@ import os
|
|
|
12
12
|
from dataclasses import asdict, dataclass, fields
|
|
13
13
|
from pathlib import Path
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
from keystone_cli._build_env import BUILD_ENV
|
|
16
|
+
|
|
17
|
+
# Baked platform defaults so `keystone login` works with NO flags (like `aws sso login`), PER ENV.
|
|
18
|
+
# NOT secrets — client id is a public identifier, issuer/api are public URLs. The env is stamped into
|
|
19
|
+
# each package at build time (`_build_env.BUILD_ENV`, from the CI PACKAGE_ENV_SUFFIX): keystone-cli-qc
|
|
20
|
+
# → "qc", plain keystone-cli → "prod", a source/local install → "dev". Override any with
|
|
21
|
+
# --issuer/--api-base / KEYSTONE_* for local testing; after first login they're cached in the config.
|
|
22
|
+
DEFAULT_CLIENT_ID = "keystone-cli" # public Keycloak client, device grant enabled (Ops-provisioned per realm)
|
|
23
|
+
|
|
24
|
+
# (issuer, api_base, agent_api_base) per env. dev/qc/staging share the NONPROD Keycloak — the public
|
|
25
|
+
# `.ops` host (NOT the cluster-internal `.int`, unreachable from a laptop) — and note dev's realm is
|
|
26
|
+
# `aip`, NOT `aip-dev`. prod lives on a SEPARATE prod Keycloak (realm `aip`); its hosts are
|
|
27
|
+
# Ops-provisioned and filled when prod onboards (the placeholders below fail loudly until then).
|
|
28
|
+
_NONPROD_KC = "https://keycloak-platform.ops.onemount.dev"
|
|
29
|
+
_ENV_DEFAULTS: dict[str, tuple[str, str, str]] = {
|
|
30
|
+
"dev": (
|
|
31
|
+
f"{_NONPROD_KC}/realms/aip",
|
|
32
|
+
"https://keystone-api-dev.aws.int.onenexus.dev",
|
|
33
|
+
"https://keystone-agent-api-dev.aws.int.onenexus.dev",
|
|
34
|
+
),
|
|
35
|
+
"qc": (
|
|
36
|
+
f"{_NONPROD_KC}/realms/aip-qc",
|
|
37
|
+
"https://keystone-api-qc.aws.int.onenexus.dev",
|
|
38
|
+
"https://keystone-agent-api-qc.aws.int.onenexus.dev",
|
|
39
|
+
),
|
|
40
|
+
"staging": (
|
|
41
|
+
f"{_NONPROD_KC}/realms/aip-staging",
|
|
42
|
+
"https://keystone-api-staging.aws.int.onenexus.dev",
|
|
43
|
+
"https://keystone-agent-api-staging.aws.int.onenexus.dev",
|
|
44
|
+
),
|
|
45
|
+
# prod Keycloak is a SEPARATE host on `.onemount.com` (note: .com, not the nonprod .dev), realm `aip`.
|
|
46
|
+
# prod Kong edge is on `.aws.int.onenexus.tech` (note: .tech, not nonprod's .dev) and drops the
|
|
47
|
+
# per-env suffix (`keystone-api`, not `keystone-api-prod`). Confirmed with Ops 2026-08-28.
|
|
48
|
+
"prod": (
|
|
49
|
+
"https://keycloak-platform.ops.onemount.com/realms/aip",
|
|
50
|
+
"https://keystone-api.aws.int.onenexus.tech",
|
|
51
|
+
"https://keystone-agent-api.aws.int.onenexus.tech",
|
|
52
|
+
),
|
|
53
|
+
}
|
|
54
|
+
DEFAULT_ISSUER, DEFAULT_API_BASE, DEFAULT_AGENT_API_BASE = _ENV_DEFAULTS.get(BUILD_ENV, _ENV_DEFAULTS["dev"])
|
|
23
55
|
|
|
24
56
|
|
|
25
57
|
@dataclass
|
|
@@ -46,6 +78,11 @@ class AuthConfig:
|
|
|
46
78
|
# the grant with the secret from the environment). Older config files lack the key and load as
|
|
47
79
|
# ``device``, which is what they are.
|
|
48
80
|
auth_mode: str = "device"
|
|
81
|
+
# FDP-3072 W6 — the package env (`_build_env.BUILD_ENV`) this config was last written for. `login`
|
|
82
|
+
# uses it to detect a cross-env config: if a qc package meets a dev-written config, the cached
|
|
83
|
+
# endpoints/workspace/tokens are stale and are dropped so the package's baked defaults win (no
|
|
84
|
+
# more silently logging into the wrong realm). Empty on pre-env configs → inferred from the issuer.
|
|
85
|
+
env: str = ""
|
|
49
86
|
|
|
50
87
|
|
|
51
88
|
def config_path() -> Path:
|