namel3ss 0.1.0a0__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.
Potentially problematic release.
This version of namel3ss might be problematic. Click here for more details.
- namel3ss-0.1.0a0/CHANGELOG.md +11 -0
- namel3ss-0.1.0a0/MANIFEST.in +4 -0
- namel3ss-0.1.0a0/PKG-INFO +123 -0
- namel3ss-0.1.0a0/README.md +110 -0
- namel3ss-0.1.0a0/VERSION +1 -0
- namel3ss-0.1.0a0/pyproject.toml +36 -0
- namel3ss-0.1.0a0/setup.cfg +4 -0
- namel3ss-0.1.0a0/src/namel3ss/__init__.py +4 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/__init__.py +5 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/agents.py +13 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/ai.py +23 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/base.py +10 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/expressions.py +55 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/nodes.py +86 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/pages.py +43 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/program.py +22 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/records.py +27 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/statements.py +107 -0
- namel3ss-0.1.0a0/src/namel3ss/ast/tool.py +11 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/actions_mode.py +39 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/app_loader.py +22 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/commands/action.py +27 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/commands/run.py +43 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/commands/ui.py +26 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/commands/validate.py +23 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/format_mode.py +30 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/io/json_io.py +19 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/io/read_source.py +16 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/json_io.py +21 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/lint_mode.py +29 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/main.py +135 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/new_mode.py +146 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/runner.py +28 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/studio_mode.py +22 -0
- namel3ss-0.1.0a0/src/namel3ss/cli/ui_mode.py +14 -0
- namel3ss-0.1.0a0/src/namel3ss/config/__init__.py +4 -0
- namel3ss-0.1.0a0/src/namel3ss/config/dotenv.py +33 -0
- namel3ss-0.1.0a0/src/namel3ss/config/loader.py +83 -0
- namel3ss-0.1.0a0/src/namel3ss/config/model.py +49 -0
- namel3ss-0.1.0a0/src/namel3ss/errors/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/errors/base.py +34 -0
- namel3ss-0.1.0a0/src/namel3ss/errors/render.py +22 -0
- namel3ss-0.1.0a0/src/namel3ss/format/__init__.py +3 -0
- namel3ss-0.1.0a0/src/namel3ss/format/formatter.py +18 -0
- namel3ss-0.1.0a0/src/namel3ss/format/rules.py +97 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/__init__.py +3 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/__init__.py +4 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/agents.py +42 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/ai.py +45 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/expressions.py +49 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/flow.py +21 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/pages.py +48 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/program.py +34 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/records.py +25 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/statements.py +122 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/lowering/tools.py +16 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/__init__.py +50 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/agents.py +33 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/ai.py +31 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/base.py +20 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/expressions.py +50 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/pages.py +43 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/program.py +28 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/statements.py +76 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/model/tools.py +11 -0
- namel3ss-0.1.0a0/src/namel3ss/ir/nodes.py +88 -0
- namel3ss-0.1.0a0/src/namel3ss/lexer/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/lexer/lexer.py +152 -0
- namel3ss-0.1.0a0/src/namel3ss/lexer/tokens.py +98 -0
- namel3ss-0.1.0a0/src/namel3ss/lint/__init__.py +4 -0
- namel3ss-0.1.0a0/src/namel3ss/lint/engine.py +125 -0
- namel3ss-0.1.0a0/src/namel3ss/lint/semantic.py +45 -0
- namel3ss-0.1.0a0/src/namel3ss/lint/text_scan.py +70 -0
- namel3ss-0.1.0a0/src/namel3ss/lint/types.py +22 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/__init__.py +3 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/agent.py +78 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/ai.py +113 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/constraints.py +37 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/core.py +166 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/expressions.py +105 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/flow.py +37 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/pages.py +76 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/program.py +45 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/records.py +66 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/statements/__init__.py +27 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/statements/control_flow.py +116 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/statements/core.py +66 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/statements/data.py +17 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/statements/letset.py +22 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/statements.py +1 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/tokens.py +35 -0
- namel3ss-0.1.0a0/src/namel3ss/parser/tool.py +29 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/__init__.py +3 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/http/client.py +24 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/mock_provider.py +5 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/provider.py +29 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/__init__.py +18 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/_shared/errors.py +20 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/_shared/parse.py +18 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/anthropic.py +55 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/gemini.py +50 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/mistral.py +51 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/mock.py +23 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/ollama.py +39 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/openai.py +55 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/providers/registry.py +38 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ai/trace.py +18 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/__init__.py +3 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/agents.py +91 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/ai_runner.py +90 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/api.py +54 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/assign.py +40 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/context.py +31 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/executor.py +77 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/expr_eval.py +110 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/records_ops.py +64 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/result.py +13 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/signals.py +6 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/executor/statements.py +99 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/memory/manager.py +52 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/memory/profile.py +17 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/memory/semantic.py +20 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/memory/short_term.py +18 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/records/service.py +105 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/store/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/store/memory_store.py +62 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/tools/registry.py +13 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ui/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/ui/actions.py +124 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/validators/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/runtime/validators/constraints.py +126 -0
- namel3ss-0.1.0a0/src/namel3ss/schema/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/schema/records.py +52 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/__init__.py +4 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/api.py +115 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/edit/__init__.py +3 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/edit/ops.py +80 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/edit/selectors.py +74 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/edit/transform.py +39 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/server.py +175 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/session.py +11 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/web/app.js +248 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/web/index.html +44 -0
- namel3ss-0.1.0a0/src/namel3ss/studio/web/styles.css +42 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/__init__.py +3 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/__pycache__/__init__.cpython-312.pyc +0 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/ai_assistant/.gitignore +1 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/ai_assistant/README.md +10 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/ai_assistant/app.ai +30 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/crud/.gitignore +1 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/crud/README.md +10 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/crud/app.ai +26 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/multi_agent/.gitignore +1 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/multi_agent/README.md +10 -0
- namel3ss-0.1.0a0/src/namel3ss/templates/multi_agent/app.ai +43 -0
- namel3ss-0.1.0a0/src/namel3ss/ui/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss/ui/manifest.py +220 -0
- namel3ss-0.1.0a0/src/namel3ss/utils/__init__.py +2 -0
- namel3ss-0.1.0a0/src/namel3ss.egg-info/PKG-INFO +123 -0
- namel3ss-0.1.0a0/src/namel3ss.egg-info/SOURCES.txt +163 -0
- namel3ss-0.1.0a0/src/namel3ss.egg-info/dependency_links.txt +1 -0
- namel3ss-0.1.0a0/src/namel3ss.egg-info/entry_points.txt +2 -0
- namel3ss-0.1.0a0/src/namel3ss.egg-info/requires.txt +3 -0
- namel3ss-0.1.0a0/src/namel3ss.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v0.1.0-alpha
|
|
4
|
+
|
|
5
|
+
- Language core (Phases 1–3): Stable keywords, parser/AST/IR contracts, deterministic defaults.
|
|
6
|
+
- Full-stack UI + actions (Phase 4): Pages, actions, and runtime wiring for forms/buttons/tables.
|
|
7
|
+
- AI + memory + tools (Phase 5): AI declarations with memory profiles and tool exposure.
|
|
8
|
+
- Multi-agent workflows (Phase 6): Agent declarations plus sequential/parallel agent execution.
|
|
9
|
+
- CLI, formatter, linter (Phase 7): File-first CLI, formatting rules, linting for grammar/safety.
|
|
10
|
+
- Studio (viewer → interactor → safe edits) (Phase 8): Manifest viewer, action runner, and guarded edits.
|
|
11
|
+
- Templates & scaffolding (Phase 10): `n3 new` with CRUD, AI assistant, and multi-agent templates.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: namel3ss
|
|
3
|
+
Version: 0.1.0a0
|
|
4
|
+
Summary: Namel3ss is an English-first, AI-native programming language for full-stack apps with inspectable AI.
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
7
|
+
Classifier: Intended Audience :: Developers
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
13
|
+
|
|
14
|
+
# Namel3ss
|
|
15
|
+
|
|
16
|
+
Namel3ss is an English-first, AI-native programming language for building full-stack applications with deterministic behavior and inspectable AI.
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
pip install namel3ss
|
|
20
|
+
n3 new crud
|
|
21
|
+
n3 crud/app.ai studio
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- [Quickstart](docs/quickstart.md)
|
|
25
|
+
- [Examples](examples/)
|
|
26
|
+
- [Changelog](CHANGELOG.md)
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
- Requires Python 3.10+
|
|
30
|
+
- `pip install namel3ss`
|
|
31
|
+
- `n3 --help` to confirm the CLI entrypoint after installation.
|
|
32
|
+
|
|
33
|
+
## Run with Ollama (local)
|
|
34
|
+
- Ensure Ollama is running locally.
|
|
35
|
+
- In your `.ai`, set `provider is "ollama"` and a local model (e.g., `model is "llama3.1"`). If omitted, the provider defaults to `mock`.
|
|
36
|
+
- Optional env overrides: `NAMEL3SS_OLLAMA_HOST`, `NAMEL3SS_OLLAMA_TIMEOUT_SECONDS`.
|
|
37
|
+
|
|
38
|
+
## Run with Tier-1 providers (cloud)
|
|
39
|
+
- Env-first config (config file optional).
|
|
40
|
+
- OpenAI: export `NAMEL3SS_OPENAI_API_KEY` (optional `NAMEL3SS_OPENAI_BASE_URL`, defaults to `https://api.openai.com`).
|
|
41
|
+
- Anthropic (Claude): export `NAMEL3SS_ANTHROPIC_API_KEY`.
|
|
42
|
+
- Gemini: export `NAMEL3SS_GEMINI_API_KEY`.
|
|
43
|
+
- Mistral: export `NAMEL3SS_MISTRAL_API_KEY`.
|
|
44
|
+
|
|
45
|
+
### Provider selection example (.ai)
|
|
46
|
+
```
|
|
47
|
+
ai "assistant":
|
|
48
|
+
provider is "openai"
|
|
49
|
+
model is "gpt-4.1"
|
|
50
|
+
system_prompt is "You are helpful."
|
|
51
|
+
|
|
52
|
+
flow "demo":
|
|
53
|
+
ask ai "assistant" with input: "Hello!" as reply
|
|
54
|
+
return reply
|
|
55
|
+
```
|
|
56
|
+
Swap `provider`/`model` to `anthropic`+`claude-3`, `gemini`+`gemini-1.5-flash`, `mistral`+`mistral-medium`, or `ollama`+`llama3.1`.
|
|
57
|
+
|
|
58
|
+
## Now / Next / Later
|
|
59
|
+
- Now: Phase 0 skeleton with docs, CI guardrails, and package scaffolding.
|
|
60
|
+
- Now: Core language contract captured for stable keywords and boundaries.
|
|
61
|
+
- Now: Editable install flow for local development and automation.
|
|
62
|
+
- Next: Lexer tokens, parser entrypoints, and AST node contracts.
|
|
63
|
+
- Next: Deterministic runtime shell with hooks for AI-augmented paths.
|
|
64
|
+
- Next: CLI stub for compile/run loops and ergonomic feedback.
|
|
65
|
+
- Later: IR lowering, optimizer passes, and reproducible execution traces.
|
|
66
|
+
- Later: Deterministic stdlib surface with sandboxed IO and tracing.
|
|
67
|
+
- Later: AI-augmented behaviors (prompted blocks, planners) gated and logged.
|
|
68
|
+
- Later: Performance profiling, caching, and correctness hardening toward v3.
|
|
69
|
+
|
|
70
|
+
## Getting Started
|
|
71
|
+
- Install editable package: `pip install -e .`
|
|
72
|
+
- Run tests: `python -m pytest -q`
|
|
73
|
+
- Compile check: `python -m compileall src -q`
|
|
74
|
+
- Enforce line limit: `python tools/line_limit_check.py`
|
|
75
|
+
|
|
76
|
+
## Start a New App
|
|
77
|
+
- Scaffold: `n3 new <template> [project_name]` (templates: `crud`, `ai-assistant`, `multi-agent`)
|
|
78
|
+
- Names default to the template; hyphens become underscores on disk.
|
|
79
|
+
- After scaffolding: `cd <project>` then `n3 app.ai studio` or `n3 app.ai actions`.
|
|
80
|
+
|
|
81
|
+
## Repository Layout
|
|
82
|
+
- `src/namel3ss/`: language packages (lexer, parser, ast, ir, runtime, cli, errors, utils)
|
|
83
|
+
- `tests/`: pytest suite (add coverage for every feature)
|
|
84
|
+
- `docs/`: roadmap and language contracts
|
|
85
|
+
- `tools/`: repo-level utilities (line-limit enforcement)
|
|
86
|
+
- `.github/workflows/`: CI automation
|
|
87
|
+
|
|
88
|
+
## Architecture at a Glance
|
|
89
|
+
- Lexer → Parser → AST → IR → Runtime executor pipeline with deterministic defaults and explicit AI boundaries.
|
|
90
|
+
- CLI is file-first (`n3 app.ai ...`) with modes for run, check, lint, format, actions, and studio UI.
|
|
91
|
+
- Runtime supports providers via registry (mock, ollama, openai, anthropic, gemini, mistral) with env-first config and standardized errors.
|
|
92
|
+
- Memory manager handles short-term, semantic, and profile contexts passed into AI calls.
|
|
93
|
+
- Templates (`n3 new ...`) ship starter apps plus `.env`-safe `.gitignore` for secrets.
|
|
94
|
+
|
|
95
|
+
## Development Notes
|
|
96
|
+
- Each source file must stay under 500 lines.
|
|
97
|
+
- One responsibility per file; if it grows, split into a folder with smaller modules.
|
|
98
|
+
- Prefer folder-first naming (e.g., `parser/core.py`, not `parser_core.py`).
|
|
99
|
+
|
|
100
|
+
### Migration note (buttons)
|
|
101
|
+
- Buttons are block-only (to avoid grammar chaos):
|
|
102
|
+
```
|
|
103
|
+
button "Run":
|
|
104
|
+
calls flow "demo"
|
|
105
|
+
```
|
|
106
|
+
- Old one-line form is rejected:
|
|
107
|
+
```
|
|
108
|
+
button "Run" calls flow "demo"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Docs
|
|
112
|
+
- [IR Reference](docs/ir.md)
|
|
113
|
+
- [Runtime Model](docs/runtime.md)
|
|
114
|
+
- [Error Reference](docs/errors.md)
|
|
115
|
+
- [Quickstart](docs/quickstart.md)
|
|
116
|
+
- [Providers](docs/providers.md)
|
|
117
|
+
- [Roadmap](docs/roadmap.md)
|
|
118
|
+
|
|
119
|
+
## Troubleshooting (providers)
|
|
120
|
+
- `Provider '<name>' requires <ENV_VAR>` → set the env var for that provider.
|
|
121
|
+
- `Provider '<name>' authentication failed` → check API key/permissions.
|
|
122
|
+
- `Provider '<name>' unreachable` → check network/DNS/firewall or ensure Ollama is running for local.
|
|
123
|
+
- `Provider '<name>' returned an invalid response` → verify model name, upstream status, and try again.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Namel3ss
|
|
2
|
+
|
|
3
|
+
Namel3ss is an English-first, AI-native programming language for building full-stack applications with deterministic behavior and inspectable AI.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
pip install namel3ss
|
|
7
|
+
n3 new crud
|
|
8
|
+
n3 crud/app.ai studio
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- [Quickstart](docs/quickstart.md)
|
|
12
|
+
- [Examples](examples/)
|
|
13
|
+
- [Changelog](CHANGELOG.md)
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
- Requires Python 3.10+
|
|
17
|
+
- `pip install namel3ss`
|
|
18
|
+
- `n3 --help` to confirm the CLI entrypoint after installation.
|
|
19
|
+
|
|
20
|
+
## Run with Ollama (local)
|
|
21
|
+
- Ensure Ollama is running locally.
|
|
22
|
+
- In your `.ai`, set `provider is "ollama"` and a local model (e.g., `model is "llama3.1"`). If omitted, the provider defaults to `mock`.
|
|
23
|
+
- Optional env overrides: `NAMEL3SS_OLLAMA_HOST`, `NAMEL3SS_OLLAMA_TIMEOUT_SECONDS`.
|
|
24
|
+
|
|
25
|
+
## Run with Tier-1 providers (cloud)
|
|
26
|
+
- Env-first config (config file optional).
|
|
27
|
+
- OpenAI: export `NAMEL3SS_OPENAI_API_KEY` (optional `NAMEL3SS_OPENAI_BASE_URL`, defaults to `https://api.openai.com`).
|
|
28
|
+
- Anthropic (Claude): export `NAMEL3SS_ANTHROPIC_API_KEY`.
|
|
29
|
+
- Gemini: export `NAMEL3SS_GEMINI_API_KEY`.
|
|
30
|
+
- Mistral: export `NAMEL3SS_MISTRAL_API_KEY`.
|
|
31
|
+
|
|
32
|
+
### Provider selection example (.ai)
|
|
33
|
+
```
|
|
34
|
+
ai "assistant":
|
|
35
|
+
provider is "openai"
|
|
36
|
+
model is "gpt-4.1"
|
|
37
|
+
system_prompt is "You are helpful."
|
|
38
|
+
|
|
39
|
+
flow "demo":
|
|
40
|
+
ask ai "assistant" with input: "Hello!" as reply
|
|
41
|
+
return reply
|
|
42
|
+
```
|
|
43
|
+
Swap `provider`/`model` to `anthropic`+`claude-3`, `gemini`+`gemini-1.5-flash`, `mistral`+`mistral-medium`, or `ollama`+`llama3.1`.
|
|
44
|
+
|
|
45
|
+
## Now / Next / Later
|
|
46
|
+
- Now: Phase 0 skeleton with docs, CI guardrails, and package scaffolding.
|
|
47
|
+
- Now: Core language contract captured for stable keywords and boundaries.
|
|
48
|
+
- Now: Editable install flow for local development and automation.
|
|
49
|
+
- Next: Lexer tokens, parser entrypoints, and AST node contracts.
|
|
50
|
+
- Next: Deterministic runtime shell with hooks for AI-augmented paths.
|
|
51
|
+
- Next: CLI stub for compile/run loops and ergonomic feedback.
|
|
52
|
+
- Later: IR lowering, optimizer passes, and reproducible execution traces.
|
|
53
|
+
- Later: Deterministic stdlib surface with sandboxed IO and tracing.
|
|
54
|
+
- Later: AI-augmented behaviors (prompted blocks, planners) gated and logged.
|
|
55
|
+
- Later: Performance profiling, caching, and correctness hardening toward v3.
|
|
56
|
+
|
|
57
|
+
## Getting Started
|
|
58
|
+
- Install editable package: `pip install -e .`
|
|
59
|
+
- Run tests: `python -m pytest -q`
|
|
60
|
+
- Compile check: `python -m compileall src -q`
|
|
61
|
+
- Enforce line limit: `python tools/line_limit_check.py`
|
|
62
|
+
|
|
63
|
+
## Start a New App
|
|
64
|
+
- Scaffold: `n3 new <template> [project_name]` (templates: `crud`, `ai-assistant`, `multi-agent`)
|
|
65
|
+
- Names default to the template; hyphens become underscores on disk.
|
|
66
|
+
- After scaffolding: `cd <project>` then `n3 app.ai studio` or `n3 app.ai actions`.
|
|
67
|
+
|
|
68
|
+
## Repository Layout
|
|
69
|
+
- `src/namel3ss/`: language packages (lexer, parser, ast, ir, runtime, cli, errors, utils)
|
|
70
|
+
- `tests/`: pytest suite (add coverage for every feature)
|
|
71
|
+
- `docs/`: roadmap and language contracts
|
|
72
|
+
- `tools/`: repo-level utilities (line-limit enforcement)
|
|
73
|
+
- `.github/workflows/`: CI automation
|
|
74
|
+
|
|
75
|
+
## Architecture at a Glance
|
|
76
|
+
- Lexer → Parser → AST → IR → Runtime executor pipeline with deterministic defaults and explicit AI boundaries.
|
|
77
|
+
- CLI is file-first (`n3 app.ai ...`) with modes for run, check, lint, format, actions, and studio UI.
|
|
78
|
+
- Runtime supports providers via registry (mock, ollama, openai, anthropic, gemini, mistral) with env-first config and standardized errors.
|
|
79
|
+
- Memory manager handles short-term, semantic, and profile contexts passed into AI calls.
|
|
80
|
+
- Templates (`n3 new ...`) ship starter apps plus `.env`-safe `.gitignore` for secrets.
|
|
81
|
+
|
|
82
|
+
## Development Notes
|
|
83
|
+
- Each source file must stay under 500 lines.
|
|
84
|
+
- One responsibility per file; if it grows, split into a folder with smaller modules.
|
|
85
|
+
- Prefer folder-first naming (e.g., `parser/core.py`, not `parser_core.py`).
|
|
86
|
+
|
|
87
|
+
### Migration note (buttons)
|
|
88
|
+
- Buttons are block-only (to avoid grammar chaos):
|
|
89
|
+
```
|
|
90
|
+
button "Run":
|
|
91
|
+
calls flow "demo"
|
|
92
|
+
```
|
|
93
|
+
- Old one-line form is rejected:
|
|
94
|
+
```
|
|
95
|
+
button "Run" calls flow "demo"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Docs
|
|
99
|
+
- [IR Reference](docs/ir.md)
|
|
100
|
+
- [Runtime Model](docs/runtime.md)
|
|
101
|
+
- [Error Reference](docs/errors.md)
|
|
102
|
+
- [Quickstart](docs/quickstart.md)
|
|
103
|
+
- [Providers](docs/providers.md)
|
|
104
|
+
- [Roadmap](docs/roadmap.md)
|
|
105
|
+
|
|
106
|
+
## Troubleshooting (providers)
|
|
107
|
+
- `Provider '<name>' requires <ENV_VAR>` → set the env var for that provider.
|
|
108
|
+
- `Provider '<name>' authentication failed` → check API key/permissions.
|
|
109
|
+
- `Provider '<name>' unreachable` → check network/DNS/firewall or ensure Ollama is running for local.
|
|
110
|
+
- `Provider '<name>' returned an invalid response` → verify model name, upstream status, and try again.
|
namel3ss-0.1.0a0/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0-alpha
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "namel3ss"
|
|
7
|
+
version = "0.1.0-alpha"
|
|
8
|
+
description = "Namel3ss is an English-first, AI-native programming language for full-stack apps with inspectable AI."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = []
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[project.optional-dependencies]
|
|
20
|
+
dev = [
|
|
21
|
+
"pytest>=7",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[tool.setuptools]
|
|
25
|
+
package-dir = {"" = "src"}
|
|
26
|
+
include-package-data = true
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["src"]
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.package-data]
|
|
32
|
+
"namel3ss.templates" = ["**/*.ai", "**/*.md"]
|
|
33
|
+
"namel3ss.studio.web" = ["**/*"]
|
|
34
|
+
|
|
35
|
+
[project.scripts]
|
|
36
|
+
n3 = "namel3ss.cli.main:main"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import List, Optional
|
|
5
|
+
|
|
6
|
+
from namel3ss.ast.base import Node
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class AIMemory(Node):
|
|
11
|
+
short_term: int = 0
|
|
12
|
+
semantic: bool = False
|
|
13
|
+
profile: bool = False
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class AIDecl(Node):
|
|
18
|
+
name: str
|
|
19
|
+
model: str
|
|
20
|
+
provider: str | None
|
|
21
|
+
system_prompt: Optional[str]
|
|
22
|
+
exposed_tools: List[str]
|
|
23
|
+
memory: AIMemory
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import List, Optional, Union
|
|
5
|
+
|
|
6
|
+
from namel3ss.ast.base import Node
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class Expression(Node):
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class Literal(Expression):
|
|
16
|
+
value: Union[str, int, bool]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass
|
|
20
|
+
class VarReference(Expression):
|
|
21
|
+
name: str
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class AttrAccess(Expression):
|
|
26
|
+
base: str
|
|
27
|
+
attrs: List[str]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass
|
|
31
|
+
class StatePath(Expression):
|
|
32
|
+
path: List[str]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass
|
|
36
|
+
class UnaryOp(Expression):
|
|
37
|
+
op: str
|
|
38
|
+
operand: Expression
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass
|
|
42
|
+
class BinaryOp(Expression):
|
|
43
|
+
op: str
|
|
44
|
+
left: Expression
|
|
45
|
+
right: Expression
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass
|
|
49
|
+
class Comparison(Expression):
|
|
50
|
+
kind: str # eq, gt, lt
|
|
51
|
+
left: Expression
|
|
52
|
+
right: Expression
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Assignable = Union[VarReference, StatePath]
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import List, Optional, Union
|
|
5
|
+
|
|
6
|
+
from namel3ss.ast.agents import AgentDecl
|
|
7
|
+
from namel3ss.ast.ai import AIDecl, AIMemory
|
|
8
|
+
from namel3ss.ast.base import Node
|
|
9
|
+
from namel3ss.ast.expressions import (
|
|
10
|
+
Assignable,
|
|
11
|
+
AttrAccess,
|
|
12
|
+
BinaryOp,
|
|
13
|
+
Comparison,
|
|
14
|
+
Expression,
|
|
15
|
+
Literal,
|
|
16
|
+
StatePath,
|
|
17
|
+
UnaryOp,
|
|
18
|
+
VarReference,
|
|
19
|
+
)
|
|
20
|
+
from namel3ss.ast.pages import ButtonItem, FormItem, PageDecl, PageItem, TableItem, TextItem, TitleItem
|
|
21
|
+
from namel3ss.ast.program import Flow, Program
|
|
22
|
+
from namel3ss.ast.statements import (
|
|
23
|
+
AskAIStmt,
|
|
24
|
+
Find,
|
|
25
|
+
ForEach,
|
|
26
|
+
If,
|
|
27
|
+
Let,
|
|
28
|
+
Match,
|
|
29
|
+
MatchCase,
|
|
30
|
+
ParallelAgentEntry,
|
|
31
|
+
Repeat,
|
|
32
|
+
Return,
|
|
33
|
+
RunAgentStmt,
|
|
34
|
+
RunAgentsParallelStmt,
|
|
35
|
+
Save,
|
|
36
|
+
Set,
|
|
37
|
+
Statement,
|
|
38
|
+
TryCatch,
|
|
39
|
+
)
|
|
40
|
+
from namel3ss.ast.tool import ToolDecl
|
|
41
|
+
from namel3ss.ast.records import FieldConstraint, FieldDecl, RecordDecl
|
|
42
|
+
|
|
43
|
+
__all__ = [
|
|
44
|
+
"Node",
|
|
45
|
+
"Flow",
|
|
46
|
+
"Program",
|
|
47
|
+
"Statement",
|
|
48
|
+
"Let",
|
|
49
|
+
"Set",
|
|
50
|
+
"If",
|
|
51
|
+
"Return",
|
|
52
|
+
"AskAIStmt",
|
|
53
|
+
"RunAgentStmt",
|
|
54
|
+
"ParallelAgentEntry",
|
|
55
|
+
"RunAgentsParallelStmt",
|
|
56
|
+
"Repeat",
|
|
57
|
+
"ForEach",
|
|
58
|
+
"MatchCase",
|
|
59
|
+
"Match",
|
|
60
|
+
"TryCatch",
|
|
61
|
+
"Save",
|
|
62
|
+
"Find",
|
|
63
|
+
"Expression",
|
|
64
|
+
"Literal",
|
|
65
|
+
"VarReference",
|
|
66
|
+
"AttrAccess",
|
|
67
|
+
"StatePath",
|
|
68
|
+
"UnaryOp",
|
|
69
|
+
"BinaryOp",
|
|
70
|
+
"Comparison",
|
|
71
|
+
"Assignable",
|
|
72
|
+
"FieldConstraint",
|
|
73
|
+
"FieldDecl",
|
|
74
|
+
"RecordDecl",
|
|
75
|
+
"PageItem",
|
|
76
|
+
"TitleItem",
|
|
77
|
+
"TextItem",
|
|
78
|
+
"FormItem",
|
|
79
|
+
"TableItem",
|
|
80
|
+
"ButtonItem",
|
|
81
|
+
"PageDecl",
|
|
82
|
+
"AIDecl",
|
|
83
|
+
"AIMemory",
|
|
84
|
+
"ToolDecl",
|
|
85
|
+
"AgentDecl",
|
|
86
|
+
]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import List
|
|
5
|
+
|
|
6
|
+
from namel3ss.ast.base import Node
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class PageItem(Node):
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class TitleItem(PageItem):
|
|
16
|
+
value: str
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass
|
|
20
|
+
class TextItem(PageItem):
|
|
21
|
+
value: str
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class FormItem(PageItem):
|
|
26
|
+
record_name: str
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass
|
|
30
|
+
class TableItem(PageItem):
|
|
31
|
+
record_name: str
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass
|
|
35
|
+
class ButtonItem(PageItem):
|
|
36
|
+
label: str
|
|
37
|
+
flow_name: str
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class PageDecl(Node):
|
|
42
|
+
name: str
|
|
43
|
+
items: List[PageItem]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import List
|
|
5
|
+
|
|
6
|
+
from namel3ss.ast.base import Node
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class Flow(Node):
|
|
11
|
+
name: str
|
|
12
|
+
body: List["Statement"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class Program(Node):
|
|
17
|
+
records: List["RecordDecl"]
|
|
18
|
+
flows: List[Flow]
|
|
19
|
+
pages: List["PageDecl"]
|
|
20
|
+
ais: List["AIDecl"]
|
|
21
|
+
tools: List["ToolDecl"]
|
|
22
|
+
agents: List["AgentDecl"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import List, Optional
|
|
5
|
+
|
|
6
|
+
from namel3ss.ast.base import Node
|
|
7
|
+
from namel3ss.ast.expressions import Expression
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class FieldConstraint(Node):
|
|
12
|
+
kind: str # present, unique, gt, lt, pattern, len_min, len_max
|
|
13
|
+
expression: Optional[Expression] = None
|
|
14
|
+
pattern: Optional[str] = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass
|
|
18
|
+
class FieldDecl(Node):
|
|
19
|
+
name: str
|
|
20
|
+
type_name: str
|
|
21
|
+
constraint: Optional[FieldConstraint]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class RecordDecl(Node):
|
|
26
|
+
name: str
|
|
27
|
+
fields: List[FieldDecl]
|