clearai-dsh 0.3.0 → 0.4.0
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/CHANGELOG.md +147 -0
- package/README.md +28 -28
- package/README.zh-CN.md +28 -28
- package/lib/client.js +861 -2555
- package/lib/domain-language.js +552 -48
- package/lib/fold.js +351 -1015
- package/lib/host.js +47 -557
- package/lib/invariant.js +9 -12
- package/lib/knowledge-view.js +363 -226
- package/lib/lang.js +81 -0
- package/package.json +1 -1
- package/presets/clearai/agent.cordis.yml +54 -82
- package/presets/clearai/clearai.patch.yml +54 -82
- package/presets/clearai/plugins/clearai-kernel.js +1590 -5437
- package/presets/clearai/plugins/ontology.js +56 -14
- package/presets/clearai/plugins/prompts.js +73 -363
- package/presets/clearai/skills/clearai-loop/SKILL.md +73 -59
- package/presets/clearai/plugins/brain.js +0 -547
- package/presets/clearai/plugins/commands.js +0 -199
- package/presets/clearai/template/knowledge/README.md +0 -25
- package/presets/clearai/template/memory/README.md +0 -34
- package/presets/clearai/template/project.md +0 -49
- package/presets/clearai/template/skills/README.md +0 -37
- package/presets/clearai/template/skills/chart-diagram-qa/SKILL.md +0 -43
- package/presets/clearai/template/skills/citation-management/SKILL.md +0 -73
- package/presets/clearai/template/skills/citation-management/references/bibtex_formatting.md +0 -908
- package/presets/clearai/template/skills/citation-management/references/citation_validation.md +0 -794
- package/presets/clearai/template/skills/citation-management/references/google_scholar_search.md +0 -725
- package/presets/clearai/template/skills/citation-management/references/metadata_extraction.md +0 -870
- package/presets/clearai/template/skills/citation-management/references/pubmed_search.md +0 -839
- package/presets/clearai/template/skills/citation-management/scripts/doi_to_bibtex.py +0 -204
- package/presets/clearai/template/skills/citation-management/scripts/extract_metadata.py +0 -569
- package/presets/clearai/template/skills/citation-management/scripts/format_bibtex.py +0 -349
- package/presets/clearai/template/skills/citation-management/scripts/generate_schematic.py +0 -139
- package/presets/clearai/template/skills/citation-management/scripts/generate_schematic_ai.py +0 -817
- package/presets/clearai/template/skills/citation-management/scripts/search_google_scholar.py +0 -282
- package/presets/clearai/template/skills/citation-management/scripts/search_pubmed.py +0 -398
- package/presets/clearai/template/skills/citation-management/scripts/validate_citations.py +0 -497
- package/presets/clearai/template/skills/data-analysis/SKILL.md +0 -92
- package/presets/clearai/template/skills/data-analysis/checklists/readiness_check.md +0 -23
- package/presets/clearai/template/skills/data-analysis/templates/analysis_report.md.tpl +0 -63
- package/presets/clearai/template/skills/data-analysis/templates/cleaning_rules_draft.yaml.tpl +0 -32
- package/presets/clearai/template/skills/data-analysis/templates/data_dictionary.md.tpl +0 -12
- package/presets/clearai/template/skills/data-analysis/templates/domain_knowledge_template.md.tpl +0 -316
- package/presets/clearai/template/skills/data-analysis/templates/feature_candidates.json.tpl +0 -20
- package/presets/clearai/template/skills/data-analysis/templates/quality_scorecard.md.tpl +0 -30
- package/presets/clearai/template/skills/data-analysis/workflows/01-data-profiling.md +0 -42
- package/presets/clearai/template/skills/data-analysis/workflows/02-quality-audit.md +0 -36
- package/presets/clearai/template/skills/data-analysis/workflows/03-physical-correlation.md +0 -25
- package/presets/clearai/template/skills/data-analysis/workflows/04-unstructured-mining.md +0 -26
- package/presets/clearai/template/skills/data-qa-analysis/SKILL.md +0 -102
- package/presets/clearai/template/skills/data-qa-analysis/checklists/readiness_check.md +0 -62
- package/presets/clearai/template/skills/data-qa-analysis/templates/best_in_class_report.md.tpl +0 -56
- package/presets/clearai/template/skills/data-qa-analysis/templates/cleaning_rules_draft.yaml.tpl +0 -56
- package/presets/clearai/template/skills/data-qa-analysis/templates/data_dictionary.md.tpl +0 -13
- package/presets/clearai/template/skills/data-qa-analysis/templates/data_source_inventory_and_lineage.md.tpl +0 -146
- package/presets/clearai/template/skills/data-qa-analysis/templates/data_status_report.md.tpl +0 -60
- package/presets/clearai/template/skills/data-qa-analysis/templates/steady_state_rules.yaml.tpl +0 -41
- package/presets/clearai/template/skills/data-qa-analysis/templates/subsystem_registry.md.tpl +0 -101
- package/presets/clearai/template/skills/data-qa-analysis/templates/unified_execution_plan.md.tpl +0 -100
- package/presets/clearai/template/skills/data-qa-analysis/workflows/01-data-source-inventory-and-lineage.md +0 -194
- package/presets/clearai/template/skills/data-qa-analysis/workflows/02-data-alignment-and-tag-semantics.md +0 -122
- package/presets/clearai/template/skills/data-qa-analysis/workflows/03-steady-state-identification.md +0 -126
- package/presets/clearai/template/skills/data-qa-analysis/workflows/04-consumption-analysis.md +0 -152
- package/presets/clearai/template/skills/data-qa-analysis/workflows/05-best-in-class-and-optimization-space.md +0 -78
- package/presets/clearai/template/skills/domain-presearch/SKILL.md +0 -131
- package/presets/clearai/template/skills/domain-presearch/checklists/domain_checklist.md +0 -24
- package/presets/clearai/template/skills/domain-presearch/references/figure_code.md +0 -78
- package/presets/clearai/template/skills/domain-presearch/references/strategic_frameworks.md +0 -38
- package/presets/clearai/template/skills/exploration-loop/SKILL.md +0 -81
- package/presets/clearai/template/skills/exploratory-data-analysis/SKILL.md +0 -77
- package/presets/clearai/template/skills/exploratory-data-analysis/references/bioinformatics_genomics_formats.md +0 -664
- package/presets/clearai/template/skills/exploratory-data-analysis/references/chemistry_molecular_formats.md +0 -664
- package/presets/clearai/template/skills/exploratory-data-analysis/references/general_scientific_formats.md +0 -518
- package/presets/clearai/template/skills/exploratory-data-analysis/references/microscopy_imaging_formats.md +0 -620
- package/presets/clearai/template/skills/exploratory-data-analysis/references/proteomics_metabolomics_formats.md +0 -517
- package/presets/clearai/template/skills/exploratory-data-analysis/references/spectroscopy_analytical_formats.md +0 -633
- package/presets/clearai/template/skills/exploratory-data-analysis/scripts/eda_analyzer.py +0 -547
- package/presets/clearai/template/skills/hypothesis-generation/SKILL.md +0 -73
- package/presets/clearai/template/skills/hypothesis-generation/references/experimental_design_patterns.md +0 -329
- package/presets/clearai/template/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +0 -198
- package/presets/clearai/template/skills/hypothesis-generation/references/literature_search_strategies.md +0 -622
- package/presets/clearai/template/skills/hypothesis-generation/scripts/generate_schematic.py +0 -139
- package/presets/clearai/template/skills/hypothesis-generation/scripts/generate_schematic_ai.py +0 -817
- package/presets/clearai/template/skills/literature-review/SKILL.md +0 -72
- package/presets/clearai/template/skills/literature-review/references/citation_styles.md +0 -166
- package/presets/clearai/template/skills/literature-review/references/database_strategies.md +0 -455
- package/presets/clearai/template/skills/literature-review/scripts/generate_pdf.py +0 -176
- package/presets/clearai/template/skills/literature-review/scripts/generate_schematic.py +0 -139
- package/presets/clearai/template/skills/literature-review/scripts/generate_schematic_ai.py +0 -817
- package/presets/clearai/template/skills/literature-review/scripts/search_databases.py +0 -303
- package/presets/clearai/template/skills/literature-review/scripts/verify_citations.py +0 -221
- package/presets/clearai/template/skills/paper-lookup/SKILL.md +0 -59
- package/presets/clearai/template/skills/paper-lookup/references/arxiv.md +0 -161
- package/presets/clearai/template/skills/paper-lookup/references/biorxiv.md +0 -118
- package/presets/clearai/template/skills/paper-lookup/references/core.md +0 -150
- package/presets/clearai/template/skills/paper-lookup/references/crossref.md +0 -181
- package/presets/clearai/template/skills/paper-lookup/references/medrxiv.md +0 -104
- package/presets/clearai/template/skills/paper-lookup/references/openalex.md +0 -174
- package/presets/clearai/template/skills/paper-lookup/references/pmc.md +0 -152
- package/presets/clearai/template/skills/paper-lookup/references/pubmed.md +0 -124
- package/presets/clearai/template/skills/paper-lookup/references/semantic-scholar.md +0 -203
- package/presets/clearai/template/skills/paper-lookup/references/unpaywall.md +0 -127
- package/presets/clearai/template/skills/process-presearch/SKILL.md +0 -196
- package/presets/clearai/template/skills/process-presearch/checklists/process_checklist.md +0 -18
- package/presets/clearai/template/skills/process-presearch/references/figure_code.md +0 -107
- package/presets/clearai/template/skills/process-presearch/references/source_attribution_example.md +0 -22
- package/presets/clearai/template/skills/process-understanding-extraction/SKILL.md +0 -69
- package/presets/clearai/template/skills/process-understanding-extraction/checklists/readiness_check.md +0 -34
- package/presets/clearai/template/skills/process-understanding-extraction/templates/docx_raw_dump_extractor.py.tpl +0 -132
- package/presets/clearai/template/skills/process-understanding-extraction/templates/entity_map_unit_topology.json.tpl +0 -86
- package/presets/clearai/template/skills/process-understanding-extraction/templates/process_brief.md.tpl +0 -89
- package/presets/clearai/template/skills/process-understanding-extraction/templates/process_brief_builder_from_raw_dump.py.tpl +0 -203
- package/presets/clearai/template/skills/process-understanding-extraction/templates/process_flow_mermaid.md.tpl +0 -41
- package/presets/clearai/template/skills/process-understanding-extraction/templates/unified_execution_plan.md.tpl +0 -53
- package/presets/clearai/template/skills/process-understanding-extraction/workflows/01-process-doc-discovery.md +0 -173
- package/presets/clearai/template/skills/process-understanding-extraction/workflows/02-process-understanding-and-diagramming.md +0 -106
- package/presets/clearai/template/skills/scientific-brainstorming/SKILL.md +0 -64
- package/presets/clearai/template/skills/scientific-brainstorming/references/brainstorming_methods.md +0 -326
- package/presets/clearai/template/skills/scientific-critical-thinking/SKILL.md +0 -72
- package/presets/clearai/template/skills/scientific-critical-thinking/references/common_biases.md +0 -364
- package/presets/clearai/template/skills/scientific-critical-thinking/references/evidence_hierarchy.md +0 -485
- package/presets/clearai/template/skills/scientific-critical-thinking/references/experimental_design.md +0 -496
- package/presets/clearai/template/skills/scientific-critical-thinking/references/logical_fallacies.md +0 -478
- package/presets/clearai/template/skills/scientific-critical-thinking/references/scientific_method.md +0 -169
- package/presets/clearai/template/skills/scientific-critical-thinking/references/statistical_pitfalls.md +0 -506
- package/presets/clearai/template/skills/skill-creator/SKILL.md +0 -109
- package/presets/clearai/template/skills/skill-creator/references/authoring-guide.md +0 -89
- package/presets/clearai/template/skills/statistical-analysis/SKILL.md +0 -79
- package/presets/clearai/template/skills/statistical-analysis/references/assumptions_and_diagnostics.md +0 -369
- package/presets/clearai/template/skills/statistical-analysis/references/bayesian_statistics.md +0 -653
- package/presets/clearai/template/skills/statistical-analysis/references/effect_sizes_and_power.md +0 -578
- package/presets/clearai/template/skills/statistical-analysis/references/reporting_standards.md +0 -469
- package/presets/clearai/template/skills/statistical-analysis/references/test_selection_guide.md +0 -129
- package/presets/clearai/template/skills/statistical-analysis/scripts/assumption_checks.py +0 -538
- package/presets/clearai/template/skills/web-artifact/SKILL.md +0 -165
- package/presets/clearai/template/skills/web-artifact/assets/renderer/renderer.css +0 -229
- package/presets/clearai/template/skills/web-artifact/assets/renderer/renderer.js +0 -373
- package/presets/clearai/template/skills/web-artifact/assets/vendor/elkjs/LICENSE +0 -263
- package/presets/clearai/template/skills/web-artifact/assets/vendor/elkjs/UPSTREAM.md +0 -26
- package/presets/clearai/template/skills/web-artifact/assets/vendor/elkjs/elk.bundled.js +0 -6605
- package/presets/clearai/template/skills/web-artifact/references/when-drawing-a-topology.md +0 -150
- package/presets/clearai/template/skills/web-artifact/references/when-the-page-must-work-offline.md +0 -62
- package/presets/clearai/template/skills/web-artifact/scripts/check_artifact.py +0 -167
- package/presets/clearai/template/skills/web-artifact/scripts/render_topology.js +0 -272
- package/presets/clearai/template/skills/what-if-oracle/LICENSE.txt +0 -5
- package/presets/clearai/template/skills/what-if-oracle/SKILL.md +0 -72
- package/presets/clearai/template/skills/what-if-oracle/references/scenario-templates.md +0 -154
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Scientific schematic generation using Nano Banana 2.
|
|
4
|
-
|
|
5
|
-
Generate any scientific diagram by describing it in natural language.
|
|
6
|
-
Nano Banana 2 handles everything automatically with smart iterative refinement.
|
|
7
|
-
|
|
8
|
-
Smart iteration: Only regenerates if quality is below threshold for your document type.
|
|
9
|
-
Quality review: Uses Gemini 3.1 Pro Preview for professional scientific evaluation.
|
|
10
|
-
|
|
11
|
-
Usage:
|
|
12
|
-
# Generate for journal paper (highest quality threshold)
|
|
13
|
-
python generate_schematic.py "CONSORT flowchart" -o flowchart.png --doc-type journal
|
|
14
|
-
|
|
15
|
-
# Generate for presentation (lower threshold, faster)
|
|
16
|
-
python generate_schematic.py "Transformer architecture" -o transformer.png --doc-type presentation
|
|
17
|
-
|
|
18
|
-
# Generate for poster
|
|
19
|
-
python generate_schematic.py "MAPK signaling pathway" -o pathway.png --doc-type poster
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
import argparse
|
|
23
|
-
import os
|
|
24
|
-
import subprocess
|
|
25
|
-
import sys
|
|
26
|
-
from pathlib import Path
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def main():
|
|
30
|
-
"""Command-line interface."""
|
|
31
|
-
parser = argparse.ArgumentParser(
|
|
32
|
-
description="Generate scientific schematics using AI with smart iterative refinement",
|
|
33
|
-
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
34
|
-
epilog="""
|
|
35
|
-
How it works:
|
|
36
|
-
Simply describe your diagram in natural language
|
|
37
|
-
Nano Banana 2 generates it automatically with:
|
|
38
|
-
- Smart iteration (only regenerates if quality is below threshold)
|
|
39
|
-
- Quality review by Gemini 3.1 Pro Preview
|
|
40
|
-
- Document-type aware quality thresholds
|
|
41
|
-
- Publication-ready output
|
|
42
|
-
|
|
43
|
-
Document Types (quality thresholds):
|
|
44
|
-
journal 8.5/10 - Nature, Science, peer-reviewed journals
|
|
45
|
-
conference 8.0/10 - Conference papers
|
|
46
|
-
thesis 8.0/10 - Dissertations, theses
|
|
47
|
-
grant 8.0/10 - Grant proposals
|
|
48
|
-
preprint 7.5/10 - arXiv, bioRxiv, etc.
|
|
49
|
-
report 7.5/10 - Technical reports
|
|
50
|
-
poster 7.0/10 - Academic posters
|
|
51
|
-
presentation 6.5/10 - Slides, talks
|
|
52
|
-
default 7.5/10 - General purpose
|
|
53
|
-
|
|
54
|
-
Examples:
|
|
55
|
-
# Generate for journal paper (strict quality)
|
|
56
|
-
python generate_schematic.py "CONSORT participant flow" -o flowchart.png --doc-type journal
|
|
57
|
-
|
|
58
|
-
# Generate for poster (moderate quality)
|
|
59
|
-
python generate_schematic.py "Transformer architecture" -o arch.png --doc-type poster
|
|
60
|
-
|
|
61
|
-
# Generate for slides (faster, lower threshold)
|
|
62
|
-
python generate_schematic.py "System diagram" -o system.png --doc-type presentation
|
|
63
|
-
|
|
64
|
-
# Custom max iterations
|
|
65
|
-
python generate_schematic.py "Complex pathway" -o pathway.png --iterations 2
|
|
66
|
-
|
|
67
|
-
# Verbose output
|
|
68
|
-
python generate_schematic.py "Circuit diagram" -o circuit.png -v
|
|
69
|
-
|
|
70
|
-
Environment Variables:
|
|
71
|
-
OPENROUTER_API_KEY Required for AI generation
|
|
72
|
-
"""
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
parser.add_argument("prompt",
|
|
76
|
-
help="Description of the diagram to generate")
|
|
77
|
-
parser.add_argument("-o", "--output", required=True,
|
|
78
|
-
help="Output file path")
|
|
79
|
-
parser.add_argument("--doc-type", default="default",
|
|
80
|
-
choices=["journal", "conference", "poster", "presentation",
|
|
81
|
-
"report", "grant", "thesis", "preprint", "default"],
|
|
82
|
-
help="Document type for quality threshold (default: default)")
|
|
83
|
-
parser.add_argument("--iterations", type=int, default=2,
|
|
84
|
-
help="Maximum refinement iterations (default: 2, max: 2)")
|
|
85
|
-
parser.add_argument("--api-key",
|
|
86
|
-
help="OpenRouter API key (or use OPENROUTER_API_KEY env var)")
|
|
87
|
-
parser.add_argument("-v", "--verbose", action="store_true",
|
|
88
|
-
help="Verbose output")
|
|
89
|
-
|
|
90
|
-
args = parser.parse_args()
|
|
91
|
-
|
|
92
|
-
# Check for API key
|
|
93
|
-
api_key = args.api_key or os.getenv("OPENROUTER_API_KEY")
|
|
94
|
-
if not api_key:
|
|
95
|
-
print("Error: OPENROUTER_API_KEY environment variable not set")
|
|
96
|
-
print("\nFor AI generation, you need an OpenRouter API key.")
|
|
97
|
-
print("Get one at: https://openrouter.ai/keys")
|
|
98
|
-
print("\nSet it with:")
|
|
99
|
-
print(" export OPENROUTER_API_KEY='your_api_key'")
|
|
100
|
-
print("\nOr use --api-key flag")
|
|
101
|
-
sys.exit(1)
|
|
102
|
-
|
|
103
|
-
# Find AI generation script
|
|
104
|
-
script_dir = Path(__file__).parent
|
|
105
|
-
ai_script = script_dir / "generate_schematic_ai.py"
|
|
106
|
-
|
|
107
|
-
if not ai_script.exists():
|
|
108
|
-
print(f"Error: AI generation script not found: {ai_script}")
|
|
109
|
-
sys.exit(1)
|
|
110
|
-
|
|
111
|
-
# Build command
|
|
112
|
-
cmd = [sys.executable, str(ai_script), args.prompt, "-o", args.output]
|
|
113
|
-
|
|
114
|
-
if args.doc_type != "default":
|
|
115
|
-
cmd.extend(["--doc-type", args.doc_type])
|
|
116
|
-
|
|
117
|
-
# Enforce max 2 iterations
|
|
118
|
-
iterations = min(args.iterations, 2)
|
|
119
|
-
if iterations != 2:
|
|
120
|
-
cmd.extend(["--iterations", str(iterations)])
|
|
121
|
-
|
|
122
|
-
if args.verbose:
|
|
123
|
-
cmd.append("-v")
|
|
124
|
-
|
|
125
|
-
# Execute — pass API key via environment to avoid exposure in process listings
|
|
126
|
-
try:
|
|
127
|
-
env = os.environ.copy()
|
|
128
|
-
if api_key:
|
|
129
|
-
env["OPENROUTER_API_KEY"] = api_key
|
|
130
|
-
result = subprocess.run(cmd, check=False, env=env)
|
|
131
|
-
sys.exit(result.returncode)
|
|
132
|
-
except Exception as e:
|
|
133
|
-
print(f"Error executing AI generation: {e}")
|
|
134
|
-
sys.exit(1)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if __name__ == "__main__":
|
|
138
|
-
main()
|
|
139
|
-
|