spaps 0.7.2 → 0.7.4
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/AI_TOOLS.json +10 -11
- package/README.md +267 -110
- package/assets/local-runtime/Dockerfile +28 -0
- package/assets/local-runtime/alembic/env.py +101 -0
- package/assets/local-runtime/alembic/path_bootstrap.py +71 -0
- package/assets/local-runtime/alembic/versions/000000000001_baseline_consolidated_schema.py +1076 -0
- package/assets/local-runtime/alembic/versions/000000000002_fix_column_types_to_match_prod.py +83 -0
- package/assets/local-runtime/alembic/versions/000000000003_fix_email_template_key_uniqueness.py +49 -0
- package/assets/local-runtime/alembic/versions/000000000004_add_hold_duration_minutes_to_dayrate_config.py +30 -0
- package/assets/local-runtime/alembic/versions/000000000005_resource_scoped_entitlements.py +77 -0
- package/assets/local-runtime/alembic/versions/000000000006_cfo_rbac_add_is_admin.py +37 -0
- package/assets/local-runtime/alembic/versions/000000000007_agent_approvals.py +158 -0
- package/assets/local-runtime/alembic/versions/000000000008_add_company_id_to_cfo_connections.py +35 -0
- package/assets/local-runtime/alembic/versions/000000000009_tx_signing.py +62 -0
- package/assets/local-runtime/alembic/versions/000000000010_affiliate_referrals.py +235 -0
- package/assets/local-runtime/alembic/versions/000000000011_checkin_call_booking.py +137 -0
- package/assets/local-runtime/alembic/versions/000000000012_subscription_application_scoping.py +55 -0
- package/assets/local-runtime/alembic/versions/000000000013_refresh_token_anomaly_context.py +61 -0
- package/assets/local-runtime/alembic/versions/000000000014_buildooor_dayrate_hire_schedule.py +39 -0
- package/assets/local-runtime/alembic/versions/000000000015_support_telemetry_platform.py +112 -0
- package/assets/local-runtime/alembic/versions/000000000016_issue_reporting_platform.py +54 -0
- package/assets/local-runtime/alembic/versions/000000000017_issue_reporting_platform_import_tracking.py +44 -0
- package/assets/local-runtime/alembic/versions/000000000018_authorization_policy_engine.py +76 -0
- package/assets/local-runtime/alembic.ini +47 -0
- package/assets/local-runtime/docker-compose.yml +61 -0
- package/assets/local-runtime/manifest.json +8 -0
- package/assets/local-runtime/scripts/container-entrypoint.sh +13 -0
- package/assets/local-runtime/scripts/fetch-prod-db.sh +112 -0
- package/assets/local-runtime/scripts/run-migrations.sh +96 -0
- package/package.json +5 -4
- package/src/ai-helper.js +176 -234
- package/src/ai-tool-spec.js +52 -20
- package/src/auth/api-key.js +119 -0
- package/src/auth/client-id.js +136 -0
- package/src/auth/client.js +169 -0
- package/src/auth/credentials.js +110 -0
- package/src/auth/device-flow.js +159 -0
- package/src/auth/env.js +57 -0
- package/src/auth/handlers.js +462 -0
- package/src/auth/http.js +74 -0
- package/src/cli-dispatcher.js +155 -24
- package/src/docs-system.js +7 -7
- package/src/error-handler.js +42 -0
- package/src/fixture-kernel.js +1143 -0
- package/src/handlers.js +252 -15
- package/src/help-system.js +3 -1
- package/src/local-runtime.js +258 -0
- package/src/local-server.js +597 -199
- package/src/project-scaffolder.js +441 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""Helpers for locating the active quickstart source tree for Alembic."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import MutableSequence, Sequence
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
_PACKAGE_DIRNAME = "spaps_server_quickstart"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _dedupe_paths(raw_paths: Sequence[str | Path]) -> list[Path]:
|
|
13
|
+
"""Normalize candidate paths while preserving first-seen order."""
|
|
14
|
+
seen: set[str] = set()
|
|
15
|
+
candidates: list[Path] = []
|
|
16
|
+
for raw_path in raw_paths:
|
|
17
|
+
if not raw_path:
|
|
18
|
+
continue
|
|
19
|
+
path = Path(raw_path).resolve()
|
|
20
|
+
normalized = str(path)
|
|
21
|
+
if normalized in seen:
|
|
22
|
+
continue
|
|
23
|
+
seen.add(normalized)
|
|
24
|
+
candidates.append(path)
|
|
25
|
+
return candidates
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def resolve_quickstart_src_path(
|
|
29
|
+
alembic_env_path: str | Path,
|
|
30
|
+
sys_path: Sequence[str],
|
|
31
|
+
) -> str | None:
|
|
32
|
+
"""Return the best source root that contains the quickstart package.
|
|
33
|
+
|
|
34
|
+
Preference order:
|
|
35
|
+
1. Existing `sys.path` entries that already expose the package. This keeps
|
|
36
|
+
Docker bind mounts like `/app/src` ahead of any packaged fallback.
|
|
37
|
+
2. Known fallback roots relative to `alembic/env.py`.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
alembic_dir = Path(alembic_env_path).resolve().parent
|
|
41
|
+
fallback_paths = [
|
|
42
|
+
Path("/app/src"),
|
|
43
|
+
alembic_dir.parent / "packages" / "python-server-quickstart" / "src",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
for candidate in _dedupe_paths([*sys_path, *fallback_paths]):
|
|
47
|
+
if (candidate / _PACKAGE_DIRNAME).exists():
|
|
48
|
+
return str(candidate)
|
|
49
|
+
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def ensure_quickstart_src_path(
|
|
54
|
+
alembic_env_path: str | Path,
|
|
55
|
+
sys_path: MutableSequence[str],
|
|
56
|
+
) -> str | None:
|
|
57
|
+
"""Move the resolved quickstart source root to the front of sys.path."""
|
|
58
|
+
|
|
59
|
+
resolved = resolve_quickstart_src_path(alembic_env_path, list(sys_path))
|
|
60
|
+
if resolved is None:
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
resolved_path = Path(resolved).resolve()
|
|
64
|
+
filtered = [
|
|
65
|
+
entry
|
|
66
|
+
for entry in sys_path
|
|
67
|
+
if not entry or Path(entry).resolve() != resolved_path
|
|
68
|
+
]
|
|
69
|
+
sys_path[:] = filtered
|
|
70
|
+
sys_path.insert(0, resolved)
|
|
71
|
+
return resolved
|