noeta-sdk 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,50 @@
1
+ # Claude Code local private config (skills travel with the project; not ignored)
2
+ .claude/settings.local.json
3
+ .claude/*.local.*
4
+ .claude/worktrees/
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ *.egg-info/
12
+ .venv/
13
+ venv/
14
+ env/
15
+ .pytest_cache/
16
+ .mypy_cache/
17
+ .ruff_cache/
18
+ .import_linter_cache/
19
+ .tox/
20
+ htmlcov/
21
+ .coverage
22
+ .coverage.*
23
+ dist/
24
+ build/
25
+ *.egg
26
+ node_modules/
27
+
28
+ # IDE / Editor
29
+ .idea/
30
+ .vscode/
31
+ *.swp
32
+ *.swo
33
+ *~
34
+
35
+ # OS
36
+ .DS_Store
37
+ Thumbs.db
38
+
39
+ # Local demo / scratch artifacts
40
+ *.sqlite
41
+ *.sqlite-shm
42
+ *.sqlite-wal
43
+ *.tmp.xml
44
+ *.tmp
45
+
46
+ # Local runtime config (contains api_key); only the noeta.config.example.json template is committed
47
+ /noeta.config.json
48
+
49
+ # Local artifacts from Playwright MCP test runs (console logs / page snapshots)
50
+ /.playwright-mcp/
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.4
2
+ Name: noeta-sdk
3
+ Version: 0.1.0
4
+ Summary: Noeta SDK: the thin in-process client surface (noeta.sdk facade — query / Client / Options / tool / extension interfaces) over the noeta-runtime engine. Like claude-agent-sdk / LangChain: import noeta.sdk, run an agent in-process; no engine internals, no HTTP.
5
+ Project-URL: Homepage, https://github.com/initxy/noeta
6
+ Project-URL: Repository, https://github.com/initxy/noeta
7
+ Author: The Noeta Authors
8
+ License-Expression: Apache-2.0
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: noeta-runtime
21
+ Description-Content-Type: text/markdown
22
+
23
+ # noeta-sdk
24
+
25
+ The thin in-process **client surface** (`noeta.sdk` facade — `query` / `Client`
26
+ / `Options` / `tool` / extension interfaces) over the
27
+ [noeta-runtime](https://github.com/initxy/noeta) engine. Like claude-agent-sdk /
28
+ LangChain: `import noeta.sdk`, run an agent in-process; no engine internals,
29
+ no HTTP.
30
+
31
+ Part of the [Noeta](https://github.com/initxy/noeta) workspace. Apache-2.0.
32
+
33
+ ```bash
34
+ pip install -e packages/noeta-sdk
35
+ ```
@@ -0,0 +1,13 @@
1
+ # noeta-sdk
2
+
3
+ The thin in-process **client surface** (`noeta.sdk` facade — `query` / `Client`
4
+ / `Options` / `tool` / extension interfaces) over the
5
+ [noeta-runtime](https://github.com/initxy/noeta) engine. Like claude-agent-sdk /
6
+ LangChain: `import noeta.sdk`, run an agent in-process; no engine internals,
7
+ no HTTP.
8
+
9
+ Part of the [Noeta](https://github.com/initxy/noeta) workspace. Apache-2.0.
10
+
11
+ ```bash
12
+ pip install -e packages/noeta-sdk
13
+ ```
@@ -0,0 +1,61 @@
1
+ """``noeta.client`` — the SDK public face.
2
+
3
+ This package exposes the *library user* entrypoints with a Claude-Agent-SDK
4
+ shape — lightweight sugar types that compile into the canonical
5
+ ``noeta.agent.spec`` identity objects the runtime hosts register and resolve.
6
+
7
+ Slice 4a (this file) lands:
8
+
9
+ * :class:`Options` — the human-friendly recipe dataclass.
10
+ * :func:`compile_options` — pure function turning ``Options`` into
11
+ ``(main_AgentSpec, tuple_of_descendant_AgentSpecs)``.
12
+ * :func:`builtin_tool_ref` — resolve a built-in tool name to its canonical
13
+ :class:`~noeta.agent.spec.ToolRef` (part of the SDK "batteries" parts table;
14
+ shared by :func:`compile_options` for string tool entries and by callers
15
+ who want to build spec tool lists manually).
16
+
17
+ Future slices (4b/4c):
18
+
19
+ * ``Client`` — a runtime host that wires compiled specs to a provider +
20
+ storage and exposes ``start``/``send_goal``/… methods.
21
+ * ``query`` — one-shot ``Iterator[EventEnvelope]`` driver.
22
+ * ``as_messages`` — event-envelope → human-readable message view.
23
+ """
24
+
25
+ from noeta.client.client import Client, query
26
+ from noeta.client.host import SdkHost
27
+ from noeta.client.messages import (
28
+ AssistantMessage,
29
+ Result,
30
+ ToolResultView,
31
+ ToolUse,
32
+ UserMessage,
33
+ as_messages,
34
+ )
35
+ from noeta.client.options import (
36
+ AgentDefinition,
37
+ Options,
38
+ SystemPromptPreset,
39
+ compile_options,
40
+ register_preset_prompt,
41
+ )
42
+ from noeta.client.parts import builtin_tool_ref
43
+
44
+
45
+ __all__ = [
46
+ "AgentDefinition",
47
+ "AssistantMessage",
48
+ "Client",
49
+ "Options",
50
+ "Result",
51
+ "SdkHost",
52
+ "SystemPromptPreset",
53
+ "ToolResultView",
54
+ "ToolUse",
55
+ "UserMessage",
56
+ "as_messages",
57
+ "builtin_tool_ref",
58
+ "compile_options",
59
+ "query",
60
+ "register_preset_prompt",
61
+ ]
@@ -0,0 +1,49 @@
1
+ """capabilities — the SDK-side projections the app's ``/capabilities`` reads.
2
+
3
+ The app product drives the engine only through ``noeta.sdk``; the composer's
4
+ selectable enums (permission /
5
+ effort modes) and the per-model vision gate are runtime facts the SDK already
6
+ depends on, so they are projected here and re-exported through ``noeta.sdk``
7
+ rather than letting the backend reach for a runtime internal (``noeta.providers``
8
+ is forbidden to ``noeta.agent.backend``).
9
+
10
+ These are small, pure projections — no state, no I/O — kept together so the one
11
+ public capabilities surface is legible.
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ from typing import Sequence
17
+
18
+ from noeta.client.options import _EFFORT_MODES, _PERMISSION_MODES
19
+
20
+
21
+ def permission_modes() -> tuple[str, ...]:
22
+ """The legal :attr:`Options.permission_mode` values, sorted (composer enum)."""
23
+ return tuple(sorted(_PERMISSION_MODES))
24
+
25
+
26
+ def effort_modes() -> tuple[str, ...]:
27
+ """The legal :attr:`Options.effort` values, sorted (composer enum)."""
28
+ return tuple(sorted(_EFFORT_MODES))
29
+
30
+
31
+ def model_capabilities(models: Sequence[str]) -> dict[str, dict[str, bool]]:
32
+ """Per-model ``{supports_vision: bool}`` for the image-attach gate.
33
+
34
+ Parallel to the plain ``models`` string list. Each selector is resolved the
35
+ SAME way the Responses vision guard does
36
+ (``resolve_alias`` → ``CATALOG.get``): a friendly alias (``opus`` / ``sonnet``
37
+ / ``haiku``) maps to its real id first; an uncatalogued / unknown selector
38
+ (test stubs like ``stub-model``) has no spec and is conservatively reported
39
+ non-vision — fail-closed, never advertise vision we cannot vouch for.
40
+ """
41
+ from noeta.providers import catalog
42
+
43
+ out: dict[str, dict[str, bool]] = {}
44
+ for model in models:
45
+ spec = catalog.CATALOG.get(catalog.resolve_alias(model))
46
+ out[model] = {
47
+ "supports_vision": bool(spec is not None and spec.supports_vision)
48
+ }
49
+ return out