copass-config 0.1.0__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.
@@ -0,0 +1,38 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Build output
5
+ dist/
6
+ *.tsbuildinfo
7
+
8
+ # Environment
9
+ .env
10
+ .env.*
11
+
12
+ # IDE
13
+ .vscode/
14
+ .idea/
15
+ *.swp
16
+ *.swo
17
+ *~
18
+
19
+ # OS
20
+ .DS_Store
21
+ Thumbs.db
22
+
23
+ # Test
24
+ coverage/
25
+
26
+ # Lerna
27
+ lerna-debug.log
28
+ .nx/cache
29
+ .nx/workspace-data
30
+
31
+ # Python
32
+ __pycache__/
33
+ *.pyc
34
+ *.pyo
35
+ *.egg-info/
36
+ .venv/
37
+ venv/
38
+ .olane
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: copass-config
3
+ Version: 0.1.0
4
+ Summary: Canonical tool descriptions, parameter descriptions, and system prompts shared across every Copass Python adapter
5
+ Project-URL: Homepage, https://github.com/olane-labs/copass-harness
6
+ Project-URL: Repository, https://github.com/olane-labs/copass-harness.git
7
+ Author: Olane Inc.
8
+ License: MIT
9
+ Keywords: config,copass,knowledge-graph,system-prompts,tool-descriptions
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Python: >=3.10
16
+ Provides-Extra: dev
17
+ Requires-Dist: mypy>=1.10; extra == 'dev'
18
+ Requires-Dist: pytest>=8.0; extra == 'dev'
19
+ Requires-Dist: ruff>=0.5; extra == 'dev'
20
+ Description-Content-Type: text/markdown
21
+
22
+ # copass-config
23
+
24
+ Canonical strings shared across every Python Copass adapter. Python mirror of [`@copass/config`](../../typescript/packages/config).
25
+
26
+ This package owns the **single source of truth** (for Python) for:
27
+
28
+ - Tool descriptions the LLM sees (`DISCOVER_DESCRIPTION`, `INTERPRET_DESCRIPTION`, `SEARCH_DESCRIPTION`, `MCP_DISCOVER_DESCRIPTION`)
29
+ - Parameter descriptions (`DISCOVER_QUERY_PARAM`, `INTERPRET_ITEMS_PARAM`, etc.)
30
+ - System prompts (`COPASS_AGENT_MCP_SYSTEM_PROMPT`, `COPASS_AGENT_SDK_SYSTEM_PROMPT`)
31
+
32
+ Every Python Copass adapter (`copass-pydantic-ai`, `copass-langchain`, `copass-anthropic-agents`, etc.) imports from here so the LLM sees identical tool semantics regardless of framework wrapping.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ pip install copass-config
38
+ ```
39
+
40
+ Zero runtime dependencies.
41
+
42
+ ## Usage
43
+
44
+ ```python
45
+ from copass_config import DISCOVER_DESCRIPTION, COPASS_AGENT_SDK_SYSTEM_PROMPT
46
+
47
+ # Register a tool whose LLM-facing description matches every other
48
+ # Copass adapter:
49
+ my_tool = Tool(
50
+ name="discover",
51
+ description=DISCOVER_DESCRIPTION,
52
+ ...
53
+ )
54
+
55
+ # Seed an agent with the canonical Copass system prompt:
56
+ agent = BaseAgent(
57
+ identity="copass-agent",
58
+ system_prompt=COPASS_AGENT_SDK_SYSTEM_PROMPT,
59
+ ...
60
+ )
61
+ ```
62
+
63
+ ## Keeping in sync with `@copass/config`
64
+
65
+ This package is hand-ported from the TS source. When the TS side changes:
66
+
67
+ 1. Update the matching constant in `src/copass_config/`.
68
+ 2. Bump the minor version in `pyproject.toml` and `__init__.py`.
69
+ 3. Republish.
70
+
71
+ A future release may auto-generate these constants from the TS package's build artifacts.
72
+
73
+ ## License
74
+
75
+ MIT.
@@ -0,0 +1,54 @@
1
+ # copass-config
2
+
3
+ Canonical strings shared across every Python Copass adapter. Python mirror of [`@copass/config`](../../typescript/packages/config).
4
+
5
+ This package owns the **single source of truth** (for Python) for:
6
+
7
+ - Tool descriptions the LLM sees (`DISCOVER_DESCRIPTION`, `INTERPRET_DESCRIPTION`, `SEARCH_DESCRIPTION`, `MCP_DISCOVER_DESCRIPTION`)
8
+ - Parameter descriptions (`DISCOVER_QUERY_PARAM`, `INTERPRET_ITEMS_PARAM`, etc.)
9
+ - System prompts (`COPASS_AGENT_MCP_SYSTEM_PROMPT`, `COPASS_AGENT_SDK_SYSTEM_PROMPT`)
10
+
11
+ Every Python Copass adapter (`copass-pydantic-ai`, `copass-langchain`, `copass-anthropic-agents`, etc.) imports from here so the LLM sees identical tool semantics regardless of framework wrapping.
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ pip install copass-config
17
+ ```
18
+
19
+ Zero runtime dependencies.
20
+
21
+ ## Usage
22
+
23
+ ```python
24
+ from copass_config import DISCOVER_DESCRIPTION, COPASS_AGENT_SDK_SYSTEM_PROMPT
25
+
26
+ # Register a tool whose LLM-facing description matches every other
27
+ # Copass adapter:
28
+ my_tool = Tool(
29
+ name="discover",
30
+ description=DISCOVER_DESCRIPTION,
31
+ ...
32
+ )
33
+
34
+ # Seed an agent with the canonical Copass system prompt:
35
+ agent = BaseAgent(
36
+ identity="copass-agent",
37
+ system_prompt=COPASS_AGENT_SDK_SYSTEM_PROMPT,
38
+ ...
39
+ )
40
+ ```
41
+
42
+ ## Keeping in sync with `@copass/config`
43
+
44
+ This package is hand-ported from the TS source. When the TS side changes:
45
+
46
+ 1. Update the matching constant in `src/copass_config/`.
47
+ 2. Bump the minor version in `pyproject.toml` and `__init__.py`.
48
+ 3. Republish.
49
+
50
+ A future release may auto-generate these constants from the TS package's build artifacts.
51
+
52
+ ## License
53
+
54
+ MIT.
@@ -0,0 +1,47 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "copass-config"
7
+ version = "0.1.0"
8
+ description = "Canonical tool descriptions, parameter descriptions, and system prompts shared across every Copass Python adapter"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Olane Inc." }]
12
+ requires-python = ">=3.10"
13
+ keywords = ["copass", "knowledge-graph", "config", "tool-descriptions", "system-prompts"]
14
+ classifiers = [
15
+ "License :: OSI Approved :: MIT License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ ]
21
+ dependencies = []
22
+
23
+ [project.optional-dependencies]
24
+ dev = [
25
+ "pytest>=8.0",
26
+ "mypy>=1.10",
27
+ "ruff>=0.5",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/olane-labs/copass-harness"
32
+ Repository = "https://github.com/olane-labs/copass-harness.git"
33
+
34
+ [tool.hatch.build.targets.wheel]
35
+ packages = ["src/copass_config"]
36
+
37
+ [tool.pytest.ini_options]
38
+ testpaths = ["tests"]
39
+
40
+ [tool.ruff]
41
+ line-length = 100
42
+ target-version = "py310"
43
+
44
+ [tool.mypy]
45
+ python_version = "3.10"
46
+ strict = true
47
+ packages = ["copass_config"]
@@ -0,0 +1,52 @@
1
+ """Canonical strings shared across every Copass agent adapter.
2
+
3
+ Python mirror of ``@copass/config``. Single source of truth for tool
4
+ descriptions, parameter descriptions, and system prompts used by every
5
+ Python Copass adapter (``copass-pydantic-ai``, ``copass-langchain``,
6
+ ``copass-anthropic-agents``, future MCP server, etc.). Editing here
7
+ and rebuilding the adapters keeps the LLM surface identical regardless
8
+ of framework wrapping.
9
+
10
+ If the TS ``@copass/config`` package changes, update the Python
11
+ constants to match and bump this package's minor version.
12
+ """
13
+
14
+ from copass_config.param_descriptions import (
15
+ DISCOVER_QUERY_PARAM,
16
+ INTERPRET_ITEMS_PARAM,
17
+ INTERPRET_QUERY_PARAM,
18
+ PRESET_PARAM,
19
+ PROJECT_ID_PARAM,
20
+ SEARCH_QUERY_PARAM,
21
+ )
22
+ from copass_config.system_prompts import (
23
+ COPASS_AGENT_MCP_SYSTEM_PROMPT,
24
+ COPASS_AGENT_SDK_SYSTEM_PROMPT,
25
+ )
26
+ from copass_config.tool_descriptions import (
27
+ DISCOVER_DESCRIPTION,
28
+ INTERPRET_DESCRIPTION,
29
+ MCP_DISCOVER_DESCRIPTION,
30
+ SEARCH_DESCRIPTION,
31
+ )
32
+
33
+ __version__ = "0.1.0"
34
+
35
+ __all__ = [
36
+ "__version__",
37
+ # Tool descriptions
38
+ "DISCOVER_DESCRIPTION",
39
+ "MCP_DISCOVER_DESCRIPTION",
40
+ "INTERPRET_DESCRIPTION",
41
+ "SEARCH_DESCRIPTION",
42
+ # Param descriptions
43
+ "DISCOVER_QUERY_PARAM",
44
+ "INTERPRET_QUERY_PARAM",
45
+ "SEARCH_QUERY_PARAM",
46
+ "INTERPRET_ITEMS_PARAM",
47
+ "PROJECT_ID_PARAM",
48
+ "PRESET_PARAM",
49
+ # System prompts
50
+ "COPASS_AGENT_MCP_SYSTEM_PROMPT",
51
+ "COPASS_AGENT_SDK_SYSTEM_PROMPT",
52
+ ]
@@ -0,0 +1,46 @@
1
+ """Parameter descriptions for Copass retrieval tools.
2
+
3
+ Hand-ported from
4
+ ``typescript/packages/config/src/param-descriptions.ts``.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+
10
+ DISCOVER_QUERY_PARAM = "Natural-language query to surface relevant context for."
11
+ """``query`` param — discover."""
12
+
13
+
14
+ INTERPRET_QUERY_PARAM = "The question the brief should answer."
15
+ """``query`` param — interpret."""
16
+
17
+
18
+ SEARCH_QUERY_PARAM = "The question to answer."
19
+ """``query`` param — search."""
20
+
21
+
22
+ INTERPRET_ITEMS_PARAM = " ".join(
23
+ [
24
+ "List of canonical_ids tuples — each tuple is the `canonical_ids` field",
25
+ "from one discover item. Pass several to synthesize across items.",
26
+ ]
27
+ )
28
+ """``items`` param — interpret."""
29
+
30
+
31
+ PROJECT_ID_PARAM = "Override the server default project_id."
32
+ """``project_id`` param — used by all three retrieval tools."""
33
+
34
+
35
+ PRESET_PARAM = "Override the server default preset."
36
+ """``preset`` param — interpret and search."""
37
+
38
+
39
+ __all__ = [
40
+ "DISCOVER_QUERY_PARAM",
41
+ "INTERPRET_QUERY_PARAM",
42
+ "SEARCH_QUERY_PARAM",
43
+ "INTERPRET_ITEMS_PARAM",
44
+ "PROJECT_ID_PARAM",
45
+ "PRESET_PARAM",
46
+ ]
@@ -0,0 +1,73 @@
1
+ """System prompts for Copass-backed agents.
2
+
3
+ Hand-ported from
4
+ ``typescript/packages/config/src/system-prompts.ts``.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+
10
+ COPASS_AGENT_MCP_SYSTEM_PROMPT = """You are a knowledgeable assistant grounded in the user's Copass knowledge graph.
11
+
12
+ The retrieval tools are context-window aware: the server automatically
13
+ excludes items already surfaced earlier in this conversation. In particular,
14
+ `mcp__copass__discover` returns ONLY new items on each call — repeated
15
+ calls never return duplicates. This makes cumulative context-loading cheap.
16
+
17
+ Approach every user turn this way:
18
+ 1. Call `mcp__copass__discover` to see what's relevant. Cheap, fast,
19
+ and guaranteed fresh signal each call.
20
+ 2. For items that look valuable, call `mcp__copass__interpret` on their
21
+ canonical_ids tuples for a drill-in brief.
22
+ 3. For broad, self-contained questions that don't need staged exploration,
23
+ use `mcp__copass__search` directly.
24
+
25
+ Don't hesitate to call `discover` multiple times in a single turn —
26
+ after an interpret brief, mid-reasoning, or whenever you realize you need
27
+ more context. Every call returns genuinely new items, so progressive
28
+ context loading is cheap and productive.
29
+
30
+ Keep answers concise. Cite canonical_ids where it helps the user verify.
31
+
32
+ Turn history is tracked for you automatically — do NOT call
33
+ `mcp__copass__context_window_*` tools; they're managed by the hosting
34
+ server."""
35
+ """Default system prompt for Copass agents backed by ``@copass/mcp``.
36
+
37
+ Uses the MCP fully-qualified tool names (``mcp__copass__*``) — the
38
+ scheme Claude Code, Claude Desktop, and the Claude Agent SDK all
39
+ expose."""
40
+
41
+
42
+ COPASS_AGENT_SDK_SYSTEM_PROMPT = """You are a knowledgeable assistant grounded in the user's Copass knowledge graph.
43
+
44
+ The retrieval tools are context-window aware: the server automatically
45
+ excludes items already surfaced earlier in this conversation. In particular,
46
+ `discover` returns ONLY new items on each call — repeated calls never
47
+ return duplicates. This makes cumulative context-loading cheap.
48
+
49
+ Approach every user turn this way:
50
+ 1. Call `discover` to see what's relevant. Cheap, fast, and guaranteed
51
+ fresh signal each call.
52
+ 2. For items that look valuable, call `interpret` on their canonical_ids
53
+ tuples for a drill-in brief.
54
+ 3. For broad, self-contained questions that don't need staged exploration,
55
+ use `search` directly.
56
+
57
+ Don't hesitate to call `discover` multiple times in a single turn —
58
+ after an interpret brief, mid-reasoning, or whenever you realize you need
59
+ more context. Every call returns genuinely new items, so progressive
60
+ context loading is cheap and productive.
61
+
62
+ Keep answers concise. Cite canonical_ids where it helps the user verify."""
63
+ """Default system prompt for Copass agents using the direct-SDK adapters
64
+ (``copass-pydantic-ai``, ``copass-langchain``, future
65
+ ``copass-anthropic-agents`` convenience wrappers). Tool names are
66
+ unprefixed because these frameworks don't use the MCP fully-qualified
67
+ naming convention."""
68
+
69
+
70
+ __all__ = [
71
+ "COPASS_AGENT_MCP_SYSTEM_PROMPT",
72
+ "COPASS_AGENT_SDK_SYSTEM_PROMPT",
73
+ ]
@@ -0,0 +1,93 @@
1
+ """Tool descriptions presented to the LLM.
2
+
3
+ Hand-ported from ``typescript/packages/config/src/tool-descriptions.ts``.
4
+ The single source of truth lives in the TS package; this module
5
+ mirrors it verbatim so Python Copass adapters (``copass-pydantic-ai``,
6
+ future ``copass-langchain``, ``copass-anthropic-agents``) show the LLM
7
+ the same tool semantics regardless of framework wrapping.
8
+
9
+ If the TS side changes, update this file to match and bump the
10
+ package's minor version.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ DISCOVER_DESCRIPTION = "\n".join(
16
+ [
17
+ "Return a ranked menu of context items relevant to a query. Each item is a",
18
+ "pointer (canonical_ids + short summary), not prose.",
19
+ "",
20
+ "Window-aware by construction: results automatically exclude items already",
21
+ "surfaced earlier in this conversation, so every call returns genuinely NEW",
22
+ "signal — never duplicates. This makes `discover` the primary context-",
23
+ "engineering primitive: call it freely whenever you need more context. Repeated",
24
+ "calls progressively map the relevant slice of the knowledge graph, and because",
25
+ "results skip what's already been seen, you never waste tokens re-consuming",
26
+ "known material.",
27
+ "",
28
+ "After calling, pass an item's canonical_ids tuple to `interpret` for a deeper",
29
+ "brief, or call `discover` again for more items.",
30
+ ]
31
+ )
32
+ """Description for the ``discover`` retrieval tool.
33
+
34
+ Leads with what the tool does, then emphasises the window-awareness /
35
+ fresh-signal property that makes repeated calls cheap and productive.
36
+ LLMs reading this should understand: call ``discover`` any time more
37
+ context is needed, not just as the first step."""
38
+
39
+
40
+ MCP_DISCOVER_DESCRIPTION = "\n".join(
41
+ [
42
+ "Return a ranked menu of context items relevant to a query. Each item is a",
43
+ "pointer (canonical_ids + short summary), not prose.",
44
+ "",
45
+ "Window-aware by construction: when a Context Window is active (pre-attached via",
46
+ "COPASS_CONTEXT_WINDOW_ID or created via `context_window_create`), results",
47
+ "automatically exclude items already surfaced earlier in this conversation.",
48
+ "Every call returns genuinely NEW signal — never duplicates.",
49
+ "",
50
+ "This makes `discover` the primary context-engineering primitive: call it",
51
+ "freely whenever you need more context. Repeated calls progressively map the",
52
+ "relevant slice of the knowledge graph, and because results skip what's",
53
+ "already been seen, you never waste tokens re-consuming known material.",
54
+ "",
55
+ "After calling, pass an item's canonical_ids tuple to `interpret` for a deeper",
56
+ "brief, or call `discover` again for more items.",
57
+ ]
58
+ )
59
+ """MCP-specific variant of :data:`DISCOVER_DESCRIPTION`.
60
+
61
+ Identical content plus one clarifying clause about how the server's
62
+ Context Window is bound — MCP consumers don't construct a
63
+ ``ContextWindow`` object themselves, they inherit one via
64
+ ``COPASS_CONTEXT_WINDOW_ID`` env var or the ``context_window_create``
65
+ tool."""
66
+
67
+
68
+ INTERPRET_DESCRIPTION = "\n".join(
69
+ [
70
+ "Return a 1–2 paragraph synthesized brief pinned to specific items picked from",
71
+ "`discover`. Pass one or more canonical_ids tuples (one per item you want to",
72
+ "include). Use this AFTER `discover` when you know which items matter.",
73
+ ]
74
+ )
75
+ """Description for the ``interpret`` retrieval tool."""
76
+
77
+
78
+ SEARCH_DESCRIPTION = "\n".join(
79
+ [
80
+ "Return a full synthesized natural-language answer in one call. Use for",
81
+ "self-contained questions that do NOT benefit from a staged discover→interpret flow.",
82
+ "Heaviest of the three tools.",
83
+ ]
84
+ )
85
+ """Description for the ``search`` retrieval tool."""
86
+
87
+
88
+ __all__ = [
89
+ "DISCOVER_DESCRIPTION",
90
+ "MCP_DISCOVER_DESCRIPTION",
91
+ "INTERPRET_DESCRIPTION",
92
+ "SEARCH_DESCRIPTION",
93
+ ]
@@ -0,0 +1,56 @@
1
+ """Smoke tests: constants are non-empty strings and importable from the
2
+ public surface."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import copass_config as cfg
7
+
8
+
9
+ def test_version_present() -> None:
10
+ assert isinstance(cfg.__version__, str)
11
+ assert cfg.__version__ == "0.1.0"
12
+
13
+
14
+ def test_tool_descriptions_non_empty() -> None:
15
+ for name in (
16
+ "DISCOVER_DESCRIPTION",
17
+ "MCP_DISCOVER_DESCRIPTION",
18
+ "INTERPRET_DESCRIPTION",
19
+ "SEARCH_DESCRIPTION",
20
+ ):
21
+ value = getattr(cfg, name)
22
+ assert isinstance(value, str), name
23
+ assert value.strip(), name
24
+
25
+
26
+ def test_param_descriptions_non_empty() -> None:
27
+ for name in (
28
+ "DISCOVER_QUERY_PARAM",
29
+ "INTERPRET_QUERY_PARAM",
30
+ "SEARCH_QUERY_PARAM",
31
+ "INTERPRET_ITEMS_PARAM",
32
+ "PROJECT_ID_PARAM",
33
+ "PRESET_PARAM",
34
+ ):
35
+ value = getattr(cfg, name)
36
+ assert isinstance(value, str), name
37
+ assert value.strip(), name
38
+
39
+
40
+ def test_system_prompts_mention_discover_and_interpret() -> None:
41
+ for name in ("COPASS_AGENT_MCP_SYSTEM_PROMPT", "COPASS_AGENT_SDK_SYSTEM_PROMPT"):
42
+ prompt = getattr(cfg, name)
43
+ assert "discover" in prompt
44
+ assert "interpret" in prompt
45
+ assert "search" in prompt
46
+
47
+
48
+ def test_mcp_prompt_uses_mcp_tool_names() -> None:
49
+ prompt = cfg.COPASS_AGENT_MCP_SYSTEM_PROMPT
50
+ assert "mcp__copass__discover" in prompt
51
+ assert "mcp__copass__interpret" in prompt
52
+
53
+
54
+ def test_sdk_prompt_uses_bare_tool_names() -> None:
55
+ prompt = cfg.COPASS_AGENT_SDK_SYSTEM_PROMPT
56
+ assert "mcp__copass__" not in prompt