@oriro/orirocli 0.1.9 → 0.1.12

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.
Files changed (166) hide show
  1. package/README.md +16 -18
  2. package/dist/cli.js +4776 -2964
  3. package/package.json +2 -2
  4. package/skills/craft/ai-engineering/SKILL.md +2 -2
  5. package/skills/graphify/SKILL.md +0 -619
  6. package/skills/graphify/__init__.py +0 -28
  7. package/skills/graphify/__main__.py +0 -4582
  8. package/skills/graphify/affected.py +0 -154
  9. package/skills/graphify/always_on/agents-md.md +0 -12
  10. package/skills/graphify/always_on/antigravity-rules.md +0 -14
  11. package/skills/graphify/always_on/claude-md.md +0 -9
  12. package/skills/graphify/always_on/gemini-md.md +0 -9
  13. package/skills/graphify/always_on/kiro-steering.md +0 -5
  14. package/skills/graphify/always_on/vscode-instructions.md +0 -17
  15. package/skills/graphify/analyze.py +0 -724
  16. package/skills/graphify/benchmark.py +0 -155
  17. package/skills/graphify/build.py +0 -487
  18. package/skills/graphify/cache.py +0 -417
  19. package/skills/graphify/callflow_html.py +0 -2020
  20. package/skills/graphify/cluster.py +0 -272
  21. package/skills/graphify/command-kilo.md +0 -15
  22. package/skills/graphify/dedup.py +0 -429
  23. package/skills/graphify/detect.py +0 -1379
  24. package/skills/graphify/diagnostics.py +0 -390
  25. package/skills/graphify/export.py +0 -1408
  26. package/skills/graphify/extract.py +0 -11570
  27. package/skills/graphify/global_graph.py +0 -159
  28. package/skills/graphify/google_workspace.py +0 -223
  29. package/skills/graphify/hooks.py +0 -457
  30. package/skills/graphify/ingest.py +0 -331
  31. package/skills/graphify/llm.py +0 -1896
  32. package/skills/graphify/manifest.py +0 -4
  33. package/skills/graphify/mcp_ingest.py +0 -392
  34. package/skills/graphify/multigraph_compat.py +0 -212
  35. package/skills/graphify/pg_introspect.py +0 -142
  36. package/skills/graphify/prs.py +0 -748
  37. package/skills/graphify/querylog.py +0 -70
  38. package/skills/graphify/report.py +0 -218
  39. package/skills/graphify/scip_ingest.py +0 -363
  40. package/skills/graphify/security.py +0 -336
  41. package/skills/graphify/semantic_cleanup.py +0 -319
  42. package/skills/graphify/serve.py +0 -1309
  43. package/skills/graphify/skill-aider.md +0 -1246
  44. package/skills/graphify/skill-amp.md +0 -613
  45. package/skills/graphify/skill-claw.md +0 -616
  46. package/skills/graphify/skill-codex.md +0 -613
  47. package/skills/graphify/skill-copilot.md +0 -616
  48. package/skills/graphify/skill-devin.md +0 -1372
  49. package/skills/graphify/skill-droid.md +0 -613
  50. package/skills/graphify/skill-kilo.md +0 -625
  51. package/skills/graphify/skill-kiro.md +0 -615
  52. package/skills/graphify/skill-opencode.md +0 -608
  53. package/skills/graphify/skill-pi.md +0 -615
  54. package/skills/graphify/skill-trae.md +0 -614
  55. package/skills/graphify/skill-vscode.md +0 -612
  56. package/skills/graphify/skill-windows.md +0 -651
  57. package/skills/graphify/skills/amp/references/add-watch.md +0 -56
  58. package/skills/graphify/skills/amp/references/exports.md +0 -71
  59. package/skills/graphify/skills/amp/references/extraction-spec.md +0 -68
  60. package/skills/graphify/skills/amp/references/github-and-merge.md +0 -46
  61. package/skills/graphify/skills/amp/references/hooks.md +0 -33
  62. package/skills/graphify/skills/amp/references/query.md +0 -249
  63. package/skills/graphify/skills/amp/references/transcribe.md +0 -48
  64. package/skills/graphify/skills/amp/references/update.md +0 -179
  65. package/skills/graphify/skills/claude/references/add-watch.md +0 -56
  66. package/skills/graphify/skills/claude/references/exports.md +0 -71
  67. package/skills/graphify/skills/claude/references/extraction-spec.md +0 -68
  68. package/skills/graphify/skills/claude/references/github-and-merge.md +0 -46
  69. package/skills/graphify/skills/claude/references/hooks.md +0 -33
  70. package/skills/graphify/skills/claude/references/query.md +0 -103
  71. package/skills/graphify/skills/claude/references/transcribe.md +0 -48
  72. package/skills/graphify/skills/claude/references/update.md +0 -179
  73. package/skills/graphify/skills/claw/references/add-watch.md +0 -56
  74. package/skills/graphify/skills/claw/references/exports.md +0 -71
  75. package/skills/graphify/skills/claw/references/extraction-spec.md +0 -29
  76. package/skills/graphify/skills/claw/references/github-and-merge.md +0 -46
  77. package/skills/graphify/skills/claw/references/hooks.md +0 -33
  78. package/skills/graphify/skills/claw/references/query.md +0 -249
  79. package/skills/graphify/skills/claw/references/transcribe.md +0 -48
  80. package/skills/graphify/skills/claw/references/update.md +0 -179
  81. package/skills/graphify/skills/codex/references/add-watch.md +0 -56
  82. package/skills/graphify/skills/codex/references/exports.md +0 -71
  83. package/skills/graphify/skills/codex/references/extraction-spec.md +0 -29
  84. package/skills/graphify/skills/codex/references/github-and-merge.md +0 -46
  85. package/skills/graphify/skills/codex/references/hooks.md +0 -33
  86. package/skills/graphify/skills/codex/references/query.md +0 -249
  87. package/skills/graphify/skills/codex/references/transcribe.md +0 -48
  88. package/skills/graphify/skills/codex/references/update.md +0 -179
  89. package/skills/graphify/skills/copilot/references/add-watch.md +0 -56
  90. package/skills/graphify/skills/copilot/references/exports.md +0 -71
  91. package/skills/graphify/skills/copilot/references/extraction-spec.md +0 -68
  92. package/skills/graphify/skills/copilot/references/github-and-merge.md +0 -46
  93. package/skills/graphify/skills/copilot/references/hooks.md +0 -33
  94. package/skills/graphify/skills/copilot/references/query.md +0 -249
  95. package/skills/graphify/skills/copilot/references/transcribe.md +0 -48
  96. package/skills/graphify/skills/copilot/references/update.md +0 -179
  97. package/skills/graphify/skills/droid/references/add-watch.md +0 -56
  98. package/skills/graphify/skills/droid/references/exports.md +0 -71
  99. package/skills/graphify/skills/droid/references/extraction-spec.md +0 -68
  100. package/skills/graphify/skills/droid/references/github-and-merge.md +0 -46
  101. package/skills/graphify/skills/droid/references/hooks.md +0 -33
  102. package/skills/graphify/skills/droid/references/query.md +0 -249
  103. package/skills/graphify/skills/droid/references/transcribe.md +0 -48
  104. package/skills/graphify/skills/droid/references/update.md +0 -179
  105. package/skills/graphify/skills/kilo/references/add-watch.md +0 -56
  106. package/skills/graphify/skills/kilo/references/exports.md +0 -71
  107. package/skills/graphify/skills/kilo/references/extraction-spec.md +0 -68
  108. package/skills/graphify/skills/kilo/references/github-and-merge.md +0 -46
  109. package/skills/graphify/skills/kilo/references/hooks.md +0 -33
  110. package/skills/graphify/skills/kilo/references/query.md +0 -249
  111. package/skills/graphify/skills/kilo/references/transcribe.md +0 -48
  112. package/skills/graphify/skills/kilo/references/update.md +0 -179
  113. package/skills/graphify/skills/kiro/references/add-watch.md +0 -56
  114. package/skills/graphify/skills/kiro/references/exports.md +0 -71
  115. package/skills/graphify/skills/kiro/references/extraction-spec.md +0 -29
  116. package/skills/graphify/skills/kiro/references/github-and-merge.md +0 -46
  117. package/skills/graphify/skills/kiro/references/hooks.md +0 -33
  118. package/skills/graphify/skills/kiro/references/query.md +0 -249
  119. package/skills/graphify/skills/kiro/references/transcribe.md +0 -48
  120. package/skills/graphify/skills/kiro/references/update.md +0 -179
  121. package/skills/graphify/skills/opencode/references/add-watch.md +0 -56
  122. package/skills/graphify/skills/opencode/references/exports.md +0 -71
  123. package/skills/graphify/skills/opencode/references/extraction-spec.md +0 -68
  124. package/skills/graphify/skills/opencode/references/github-and-merge.md +0 -46
  125. package/skills/graphify/skills/opencode/references/hooks.md +0 -33
  126. package/skills/graphify/skills/opencode/references/query.md +0 -249
  127. package/skills/graphify/skills/opencode/references/transcribe.md +0 -48
  128. package/skills/graphify/skills/opencode/references/update.md +0 -179
  129. package/skills/graphify/skills/pi/references/add-watch.md +0 -56
  130. package/skills/graphify/skills/pi/references/exports.md +0 -71
  131. package/skills/graphify/skills/pi/references/extraction-spec.md +0 -29
  132. package/skills/graphify/skills/pi/references/github-and-merge.md +0 -46
  133. package/skills/graphify/skills/pi/references/hooks.md +0 -33
  134. package/skills/graphify/skills/pi/references/query.md +0 -249
  135. package/skills/graphify/skills/pi/references/transcribe.md +0 -48
  136. package/skills/graphify/skills/pi/references/update.md +0 -179
  137. package/skills/graphify/skills/trae/references/add-watch.md +0 -56
  138. package/skills/graphify/skills/trae/references/exports.md +0 -71
  139. package/skills/graphify/skills/trae/references/extraction-spec.md +0 -68
  140. package/skills/graphify/skills/trae/references/github-and-merge.md +0 -46
  141. package/skills/graphify/skills/trae/references/hooks.md +0 -35
  142. package/skills/graphify/skills/trae/references/query.md +0 -249
  143. package/skills/graphify/skills/trae/references/transcribe.md +0 -48
  144. package/skills/graphify/skills/trae/references/update.md +0 -179
  145. package/skills/graphify/skills/vscode/references/add-watch.md +0 -56
  146. package/skills/graphify/skills/vscode/references/exports.md +0 -71
  147. package/skills/graphify/skills/vscode/references/extraction-spec.md +0 -68
  148. package/skills/graphify/skills/vscode/references/github-and-merge.md +0 -46
  149. package/skills/graphify/skills/vscode/references/hooks.md +0 -33
  150. package/skills/graphify/skills/vscode/references/query.md +0 -249
  151. package/skills/graphify/skills/vscode/references/transcribe.md +0 -48
  152. package/skills/graphify/skills/vscode/references/update.md +0 -179
  153. package/skills/graphify/skills/windows/references/add-watch.md +0 -56
  154. package/skills/graphify/skills/windows/references/exports.md +0 -71
  155. package/skills/graphify/skills/windows/references/extraction-spec.md +0 -68
  156. package/skills/graphify/skills/windows/references/github-and-merge.md +0 -46
  157. package/skills/graphify/skills/windows/references/hooks.md +0 -33
  158. package/skills/graphify/skills/windows/references/query.md +0 -249
  159. package/skills/graphify/skills/windows/references/transcribe.md +0 -48
  160. package/skills/graphify/skills/windows/references/update.md +0 -179
  161. package/skills/graphify/symbol_resolution.py +0 -538
  162. package/skills/graphify/transcribe.py +0 -184
  163. package/skills/graphify/tree_html.py +0 -582
  164. package/skills/graphify/validate.py +0 -72
  165. package/skills/graphify/watch.py +0 -898
  166. package/skills/graphify/wiki.py +0 -282
@@ -1,142 +0,0 @@
1
- from __future__ import annotations
2
- from pathlib import Path
3
- from graphify.extract import extract_sql
4
-
5
-
6
- def _quote_ident(name: str) -> str:
7
- """Double-quote a PostgreSQL identifier, escaping embedded double-quotes."""
8
- return '"' + name.replace('"', '""') + '"'
9
-
10
-
11
- def introspect_postgres(dsn: str | None = None) -> dict:
12
- """Connect to PostgreSQL, reconstruct DDL, and extract via extract_sql()."""
13
- try:
14
- import psycopg
15
- except ModuleNotFoundError:
16
- raise ImportError(
17
- "psycopg is required for --postgres. "
18
- "Install with: pip install 'graphify[postgres]'"
19
- )
20
-
21
- try:
22
- conn = psycopg.connect(dsn or "") # empty string = PG* env vars
23
- except psycopg.OperationalError as exc:
24
- # Sanitize: strip the DSN/credentials that psycopg may embed in the
25
- # OperationalError message (e.g. "connection to server … failed: …\nDETAIL: …")
26
- msg = str(exc).split("\n")[0]
27
- raise ConnectionError(f"could not connect to PostgreSQL: {msg}") from None
28
-
29
- try:
30
- conn.execute("SET TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE")
31
-
32
- # 1. Query tables
33
- with conn.cursor() as cur:
34
- cur.execute("""
35
- SELECT table_schema, table_name, table_type
36
- FROM information_schema.tables
37
- WHERE table_schema NOT IN ('pg_catalog', 'information_schema')
38
- ORDER BY table_schema, table_name;
39
- """)
40
- tables = cur.fetchall()
41
-
42
- # 2. Query views
43
- cur.execute("""
44
- SELECT table_schema, table_name, view_definition
45
- FROM information_schema.views
46
- WHERE table_schema NOT IN ('pg_catalog', 'information_schema')
47
- ORDER BY table_schema, table_name;
48
- """)
49
- views = cur.fetchall()
50
-
51
- # 3. Query routines (functions/procedures), including language
52
- cur.execute("""
53
- SELECT routine_schema, routine_name, routine_type,
54
- routine_definition, external_language
55
- FROM information_schema.routines
56
- WHERE routine_schema NOT IN ('pg_catalog', 'information_schema')
57
- ORDER BY routine_schema, routine_name;
58
- """)
59
- routines = cur.fetchall()
60
-
61
- # 4. Query foreign keys — grouped by constraint to handle composites
62
- cur.execute("""
63
- SELECT
64
- tc.constraint_name,
65
- kcu1.table_schema,
66
- kcu1.table_name,
67
- ARRAY_AGG(kcu1.column_name ORDER BY kcu1.ordinal_position) AS columns,
68
- kcu2.table_schema AS foreign_table_schema,
69
- kcu2.table_name AS foreign_table_name,
70
- ARRAY_AGG(kcu2.column_name ORDER BY kcu2.ordinal_position) AS foreign_columns
71
- FROM
72
- information_schema.table_constraints AS tc
73
- JOIN information_schema.referential_constraints AS rc
74
- ON tc.constraint_name = rc.constraint_name
75
- AND tc.table_schema = rc.constraint_schema
76
- JOIN information_schema.key_column_usage AS kcu1
77
- ON tc.constraint_name = kcu1.constraint_name
78
- AND tc.table_schema = kcu1.table_schema
79
- JOIN information_schema.key_column_usage AS kcu2
80
- ON rc.unique_constraint_name = kcu2.constraint_name
81
- AND rc.unique_constraint_schema = kcu2.table_schema
82
- AND kcu1.position_in_unique_constraint = kcu2.ordinal_position
83
- WHERE tc.constraint_type = 'FOREIGN KEY'
84
- AND tc.table_schema NOT IN ('pg_catalog', 'information_schema')
85
- GROUP BY tc.constraint_name, kcu1.table_schema, kcu1.table_name,
86
- kcu2.table_schema, kcu2.table_name
87
- ORDER BY kcu1.table_schema, kcu1.table_name;
88
- """)
89
- fks = cur.fetchall()
90
- finally:
91
- conn.close()
92
-
93
- ddl = []
94
-
95
- # Tables — quote identifiers to handle reserved words, hyphens, mixed-case
96
- for schema, name, ttype in tables:
97
- if ttype == "BASE TABLE":
98
- ddl.append(f"CREATE TABLE {_quote_ident(schema)}.{_quote_ident(name)} (id INT);")
99
-
100
- # Views — real body if available, stub if NULL (permission denied)
101
- for schema, name, body in views:
102
- if body:
103
- ddl.append(f"CREATE VIEW {_quote_ident(schema)}.{_quote_ident(name)} AS {body};")
104
- else:
105
- ddl.append(f"CREATE VIEW {_quote_ident(schema)}.{_quote_ident(name)} AS SELECT 1;")
106
-
107
- # Functions & Procedures — real body if available, stub if NULL
108
- # Use $gfx$ as the dollar-quote tag to avoid collision with $$ inside bodies.
109
- # Use external_language from the catalog; fall back to plpgsql if NULL/blank.
110
- for schema, name, rtype, body, ext_lang in routines:
111
- lang = (ext_lang or "plpgsql").lower()
112
- fn_sig = f"{_quote_ident(schema)}.{_quote_ident(name)}()"
113
- stub_body = "BEGIN SELECT 1; END;"
114
- if rtype in ("FUNCTION", "PROCEDURE"):
115
- actual_body = body if body else stub_body
116
- # Represent PROCEDUREs as FUNCTION so tree-sitter-sql can parse them
117
- ddl.append(
118
- f"CREATE FUNCTION {fn_sig} RETURNS void"
119
- f" AS $gfx$ {actual_body} $gfx$ LANGUAGE {lang};"
120
- )
121
-
122
- # FK edges — one ALTER TABLE per constraint (handles composite FKs correctly)
123
- for constraint_name, t_schema, t_name, cols, r_schema, r_name, r_cols in fks:
124
- col_list = ", ".join(_quote_ident(c) for c in cols)
125
- ref_col_list = ", ".join(_quote_ident(c) for c in r_cols)
126
- ddl.append(
127
- f"ALTER TABLE {_quote_ident(t_schema)}.{_quote_ident(t_name)} "
128
- f"ADD CONSTRAINT {_quote_ident(constraint_name)} "
129
- f"FOREIGN KEY ({col_list}) REFERENCES {_quote_ident(r_schema)}.{_quote_ident(r_name)}({ref_col_list});"
130
- )
131
-
132
- ddl_string = "\n".join(ddl)
133
-
134
- # Determine host/dbname for virtual path DSN sanitization
135
- info = psycopg.conninfo.conninfo_to_dict(dsn or "")
136
- host = info.get("host", "localhost")
137
- dbname = info.get("dbname", "db")
138
- virtual_path = Path(f"postgresql://{host}/{dbname}")
139
-
140
- # Pass virtual path and in-memory DDL content to extract_sql
141
- result = extract_sql(virtual_path, content=ddl_string)
142
- return result