pythia-plsql 0.1.0__tar.gz → 0.1.2__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.
- {pythia_plsql-0.1.0/scripts/pythia_plsql.egg-info → pythia_plsql-0.1.2}/PKG-INFO +14 -2
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/README.md +13 -1
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/pyproject.toml +1 -1
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/scripts/pythia.py +40 -2
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2/scripts/pythia_plsql.egg-info}/PKG-INFO +14 -2
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-write/SKILL.md +3 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/tests/test_phase1.py +13 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/LICENSE +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/compile-errors.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/dependencies.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/impact.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/invalid-objects.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/name-occupants.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/object-source.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/plscope-enabled.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/plscope-statements.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/plscope-usages.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/session-privileges.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/similar-candidates.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/queries/source.sql +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/scripts/pythia_plsql.egg-info/SOURCES.txt +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/scripts/pythia_plsql.egg-info/dependency_links.txt +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/scripts/pythia_plsql.egg-info/entry_points.txt +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/scripts/pythia_plsql.egg-info/requires.txt +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/scripts/pythia_plsql.egg-info/top_level.txt +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/setup.cfg +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-apply/SKILL.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-explore/SKILL.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-explore/reference/data-dictionary.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-impact/SKILL.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-review/SKILL.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-review/reference/antipatterns.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-setup/SKILL.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-skill-author/SKILL.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/skills/plsql-write/reference/patterns.md +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/tests/test_install.py +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/tests/test_phase2.py +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/tests/test_phase3.py +0 -0
- {pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/tests/test_phase5.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythia-plsql
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/thaildhe172591/pythia
|
|
@@ -12,10 +12,16 @@ License-File: LICENSE
|
|
|
12
12
|
Requires-Dist: oracledb>=2.0
|
|
13
13
|
Dynamic: license-file
|
|
14
14
|
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img src="https://raw.githubusercontent.com/thaildhe172591/pythia/main/assets/logo.png" alt="pythia" width="280" />
|
|
17
|
+
</p>
|
|
18
|
+
|
|
15
19
|
# pythia
|
|
16
20
|
|
|
17
21
|
> Oracle's MCP gives your agent a connection. **pythia gives it the judgment to use it.**
|
|
18
22
|
|
|
23
|
+
**English** · [Tiếng Việt](README.vi.md)
|
|
24
|
+
|
|
19
25
|
[](https://github.com/thaildhe172591/pythia/actions/workflows/ci.yml)
|
|
20
26
|
[](LICENSE)
|
|
21
27
|

|
|
@@ -79,6 +85,12 @@ for internal mirrors) — without Node it copies the bundled skill pack into
|
|
|
79
85
|
`.claude/skills/` and `.agents/skills/`. Skills alone: `npx skills add
|
|
80
86
|
thaildhe172591/pythia`, or `/plugin marketplace add thaildhe172591/pythia`.
|
|
81
87
|
|
|
88
|
+
`pip install` is **once per machine**; `pythia install` is **once per
|
|
89
|
+
project** — run it in each repo's root to drop the skills and a fresh
|
|
90
|
+
`.pythia/connections.json` there. The CLI always reads the config of the
|
|
91
|
+
project you are standing in (searched upward from the current directory,
|
|
92
|
+
no global fallback), so one global CLI never mixes up databases.
|
|
93
|
+
|
|
82
94
|
Running from a clone works too — `python scripts/pythia.py <command>`; every
|
|
83
95
|
printed follow-up command matches how you invoked it. Windows, macOS, Linux
|
|
84
96
|
and WSL are all CI-tested.
|
|
@@ -90,7 +102,7 @@ and WSL are all CI-tested.
|
|
|
90
102
|
| `check` connectivity + counts | `deps` what it depends on | `apply` the six-step write |
|
|
91
103
|
| `ls` find objects | `impact` what depends on it | `journal` list · diff · export · restore |
|
|
92
104
|
| `src` source, compiler line numbers | `errors` compile errors, line:col | `policy` show · set |
|
|
93
|
-
| `args` signatures | `invalid` everything broken | |
|
|
105
|
+
| `args` signatures | `invalid` everything broken | `unistr` exact non-ASCII literals |
|
|
94
106
|
| `ddl` via DBMS_METADATA | `plscope` exact identifier usages | |
|
|
95
107
|
| `cols` columns + types | `similar` programs named like this | |
|
|
96
108
|
| `grep` search all source | | |
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/thaildhe172591/pythia/main/assets/logo.png" alt="pythia" width="280" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# pythia
|
|
2
6
|
|
|
3
7
|
> Oracle's MCP gives your agent a connection. **pythia gives it the judgment to use it.**
|
|
4
8
|
|
|
9
|
+
**English** · [Tiếng Việt](README.vi.md)
|
|
10
|
+
|
|
5
11
|
[](https://github.com/thaildhe172591/pythia/actions/workflows/ci.yml)
|
|
6
12
|
[](LICENSE)
|
|
7
13
|

|
|
@@ -65,6 +71,12 @@ for internal mirrors) — without Node it copies the bundled skill pack into
|
|
|
65
71
|
`.claude/skills/` and `.agents/skills/`. Skills alone: `npx skills add
|
|
66
72
|
thaildhe172591/pythia`, or `/plugin marketplace add thaildhe172591/pythia`.
|
|
67
73
|
|
|
74
|
+
`pip install` is **once per machine**; `pythia install` is **once per
|
|
75
|
+
project** — run it in each repo's root to drop the skills and a fresh
|
|
76
|
+
`.pythia/connections.json` there. The CLI always reads the config of the
|
|
77
|
+
project you are standing in (searched upward from the current directory,
|
|
78
|
+
no global fallback), so one global CLI never mixes up databases.
|
|
79
|
+
|
|
68
80
|
Running from a clone works too — `python scripts/pythia.py <command>`; every
|
|
69
81
|
printed follow-up command matches how you invoked it. Windows, macOS, Linux
|
|
70
82
|
and WSL are all CI-tested.
|
|
@@ -76,7 +88,7 @@ and WSL are all CI-tested.
|
|
|
76
88
|
| `check` connectivity + counts | `deps` what it depends on | `apply` the six-step write |
|
|
77
89
|
| `ls` find objects | `impact` what depends on it | `journal` list · diff · export · restore |
|
|
78
90
|
| `src` source, compiler line numbers | `errors` compile errors, line:col | `policy` show · set |
|
|
79
|
-
| `args` signatures | `invalid` everything broken | |
|
|
91
|
+
| `args` signatures | `invalid` everything broken | `unistr` exact non-ASCII literals |
|
|
80
92
|
| `ddl` via DBMS_METADATA | `plscope` exact identifier usages | |
|
|
81
93
|
| `cols` columns + types | `similar` programs named like this | |
|
|
82
94
|
| `grep` search all source | | |
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythia-plsql"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -42,6 +42,7 @@ you always know whether you saw everything.
|
|
|
42
42
|
pythia journal restore <id>
|
|
43
43
|
pythia policy
|
|
44
44
|
pythia install
|
|
45
|
+
pythia unistr "Nhóm không được để trống"
|
|
45
46
|
"""
|
|
46
47
|
import argparse
|
|
47
48
|
import json
|
|
@@ -1300,6 +1301,36 @@ def cmd_conventions(conn, schema, ns):
|
|
|
1300
1301
|
print(f"\nProse rules for agents: {md}")
|
|
1301
1302
|
|
|
1302
1303
|
|
|
1304
|
+
# unistr escapes. Single quote doubles to '' per SQL (a \' is ORA-01756 for
|
|
1305
|
+
# Oracle); backslash doubles for unistr itself.
|
|
1306
|
+
UNISTR_ESC = {0: r"\0", 8: r"\b", 9: r"\t", 10: r"\n", 13: r"\r",
|
|
1307
|
+
11: r"\v", 12: r"\f", 92: "\\\\", 39: "''"}
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
def to_unistr(text):
|
|
1311
|
+
r"""A National-charset-safe Oracle literal for any text. Non-ASCII goes
|
|
1312
|
+
to \XXXX escapes, so the statement survives every client/DB charset on
|
|
1313
|
+
the way in — the standard way to keep Vietnamese messages exact."""
|
|
1314
|
+
out = []
|
|
1315
|
+
for ch in text:
|
|
1316
|
+
cp = ord(ch)
|
|
1317
|
+
if cp in UNISTR_ESC:
|
|
1318
|
+
out.append(UNISTR_ESC[cp])
|
|
1319
|
+
elif 0x1F < cp < 0x7F:
|
|
1320
|
+
out.append(ch)
|
|
1321
|
+
elif cp > 0xFFFF:
|
|
1322
|
+
out.append("\\U%08X" % cp) # beyond the BMP: \U + 8 hex
|
|
1323
|
+
else:
|
|
1324
|
+
out.append("\\%04X" % cp)
|
|
1325
|
+
return "unistr('%s')" % "".join(out)
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
def cmd_unistr(conn, schema, ns):
|
|
1329
|
+
text = " ".join(ns.text) if ns.text else sys.stdin.read().rstrip("\n")
|
|
1330
|
+
u = to_unistr(text)
|
|
1331
|
+
print("'loi:'||%s||':loi'" % u if ns.loi else u)
|
|
1332
|
+
|
|
1333
|
+
|
|
1303
1334
|
DEFAULT_SKILLS_SOURCE = "thaildhe172591/pythia"
|
|
1304
1335
|
|
|
1305
1336
|
# Kept byte-identical to examples/connections.example.json —
|
|
@@ -1398,9 +1429,10 @@ COMMANDS = {"check": cmd_check, "ls": cmd_ls, "src": cmd_src, "args": cmd_args,
|
|
|
1398
1429
|
"invalid": cmd_invalid, "errors": cmd_errors, "deps": cmd_deps,
|
|
1399
1430
|
"impact": cmd_impact, "similar": cmd_similar, "plscope": cmd_plscope,
|
|
1400
1431
|
"policy": cmd_policy, "journal": cmd_journal, "apply": cmd_apply,
|
|
1401
|
-
"conventions": cmd_conventions, "install": cmd_install
|
|
1432
|
+
"conventions": cmd_conventions, "install": cmd_install,
|
|
1433
|
+
"unistr": cmd_unistr}
|
|
1402
1434
|
|
|
1403
|
-
NO_DB_COMMANDS = {"policy", "journal", "conventions", "install"}
|
|
1435
|
+
NO_DB_COMMANDS = {"policy", "journal", "conventions", "install", "unistr"}
|
|
1404
1436
|
|
|
1405
1437
|
|
|
1406
1438
|
# --- CLI ---------------------------------------------------------------------
|
|
@@ -1499,6 +1531,12 @@ def build_parser():
|
|
|
1499
1531
|
help="impact depth for the preview (default 3)")
|
|
1500
1532
|
sub.add_parser("conventions", parents=[common()],
|
|
1501
1533
|
help="show the project's house-style naming patterns")
|
|
1534
|
+
s = sub.add_parser("unistr", parents=[common()],
|
|
1535
|
+
help="Oracle unistr('...') literal for non-ASCII text "
|
|
1536
|
+
"(Vietnamese messages stay exact)")
|
|
1537
|
+
s.add_argument("text", nargs="*", help="text; omit to read stdin")
|
|
1538
|
+
s.add_argument("--loi", action="store_true",
|
|
1539
|
+
help="wrap as 'loi:'||unistr(...)||':loi'")
|
|
1502
1540
|
s = sub.add_parser("install", parents=[common()],
|
|
1503
1541
|
help="install the skill pack and scaffold .pythia/ config")
|
|
1504
1542
|
s.add_argument("--source", default=DEFAULT_SKILLS_SOURCE,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythia-plsql
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/thaildhe172591/pythia
|
|
@@ -12,10 +12,16 @@ License-File: LICENSE
|
|
|
12
12
|
Requires-Dist: oracledb>=2.0
|
|
13
13
|
Dynamic: license-file
|
|
14
14
|
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img src="https://raw.githubusercontent.com/thaildhe172591/pythia/main/assets/logo.png" alt="pythia" width="280" />
|
|
17
|
+
</p>
|
|
18
|
+
|
|
15
19
|
# pythia
|
|
16
20
|
|
|
17
21
|
> Oracle's MCP gives your agent a connection. **pythia gives it the judgment to use it.**
|
|
18
22
|
|
|
23
|
+
**English** · [Tiếng Việt](README.vi.md)
|
|
24
|
+
|
|
19
25
|
[](https://github.com/thaildhe172591/pythia/actions/workflows/ci.yml)
|
|
20
26
|
[](LICENSE)
|
|
21
27
|

|
|
@@ -79,6 +85,12 @@ for internal mirrors) — without Node it copies the bundled skill pack into
|
|
|
79
85
|
`.claude/skills/` and `.agents/skills/`. Skills alone: `npx skills add
|
|
80
86
|
thaildhe172591/pythia`, or `/plugin marketplace add thaildhe172591/pythia`.
|
|
81
87
|
|
|
88
|
+
`pip install` is **once per machine**; `pythia install` is **once per
|
|
89
|
+
project** — run it in each repo's root to drop the skills and a fresh
|
|
90
|
+
`.pythia/connections.json` there. The CLI always reads the config of the
|
|
91
|
+
project you are standing in (searched upward from the current directory,
|
|
92
|
+
no global fallback), so one global CLI never mixes up databases.
|
|
93
|
+
|
|
82
94
|
Running from a clone works too — `python scripts/pythia.py <command>`; every
|
|
83
95
|
printed follow-up command matches how you invoked it. Windows, macOS, Linux
|
|
84
96
|
and WSL are all CI-tested.
|
|
@@ -90,7 +102,7 @@ and WSL are all CI-tested.
|
|
|
90
102
|
| `check` connectivity + counts | `deps` what it depends on | `apply` the six-step write |
|
|
91
103
|
| `ls` find objects | `impact` what depends on it | `journal` list · diff · export · restore |
|
|
92
104
|
| `src` source, compiler line numbers | `errors` compile errors, line:col | `policy` show · set |
|
|
93
|
-
| `args` signatures | `invalid` everything broken | |
|
|
105
|
+
| `args` signatures | `invalid` everything broken | `unistr` exact non-ASCII literals |
|
|
94
106
|
| `ddl` via DBMS_METADATA | `plscope` exact identifier usages | |
|
|
95
107
|
| `cols` columns + types | `similar` programs named like this | |
|
|
96
108
|
| `grep` search all source | | |
|
|
@@ -33,6 +33,9 @@ existing ones — not to introduce a better style.
|
|
|
33
33
|
- End the file with the PL/SQL block's `;` and a final line holding `/`.
|
|
34
34
|
- Name the object unqualified, or qualified with the exact schema the
|
|
35
35
|
connection targets — a mismatch is refused at apply time.
|
|
36
|
+
- **Non-ASCII string literals** (Vietnamese messages, any accented text):
|
|
37
|
+
never paste raw — run `pythia unistr "<text>"` and use the printed
|
|
38
|
+
`unistr('...')`, so the text survives every client/DB charset exactly.
|
|
36
39
|
5. **Check yourself before handing off.** Reread against
|
|
37
40
|
`reference/patterns.md` — cursor and bulk patterns, exception discipline,
|
|
38
41
|
bind variables, commit ownership.
|
|
@@ -240,6 +240,19 @@ def test_source_unit_filter():
|
|
|
240
240
|
assert pythia.filter_units(rows, body=False, spec=False) == rows
|
|
241
241
|
|
|
242
242
|
|
|
243
|
+
def test_to_unistr():
|
|
244
|
+
r"""Ported from the field tool's self-check: Vietnamese exact, quote
|
|
245
|
+
doubled per SQL (never \'), backslash doubled, beyond-BMP \U form."""
|
|
246
|
+
u = pythia.to_unistr
|
|
247
|
+
assert u("Nhóm không được để trống") == \
|
|
248
|
+
r"unistr('Nh\00F3m kh\00F4ng \0111\01B0\1EE3c \0111\1EC3 tr\1ED1ng')"
|
|
249
|
+
assert u("Mã bệnh") == r"unistr('M\00E3 b\1EC7nh')"
|
|
250
|
+
assert u("O'Brien") == "unistr('O''Brien')"
|
|
251
|
+
assert u("a\\b") == r"unistr('a\\b')"
|
|
252
|
+
assert u("\U0001F600") == r"unistr('\U0001F600')"
|
|
253
|
+
assert u("ABC 123") == "unistr('ABC 123')"
|
|
254
|
+
|
|
255
|
+
|
|
243
256
|
def test_json_envelope():
|
|
244
257
|
s = pythia.json_envelope("ls", "DEV", "OWNER1", ["A", "B"],
|
|
245
258
|
[(1, datetime.date(2026, 1, 2))], truncated=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythia_plsql-0.1.0 → pythia_plsql-0.1.2}/scripts/pythia_plsql.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|