Skip to content

Commit 6c9a1f9

Browse files
committed
bin32 add folder used by VCL_Anthropic demo
1 parent 1c5b81c commit 6c9a1f9

17 files changed

Lines changed: 1389 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"anthropic": true
3+
}

bin32/VCL_Anthropic/VCL_Anthropic-chat-sessions.json

Lines changed: 172 additions & 0 deletions
Large diffs are not rendered by default.

bin32/VCL_Anthropic/VCL_Anthropic-exchange-debug.json

Lines changed: 176 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"categoryConfigMode": "replace",
3+
"categories": [
4+
{
5+
"id": "allModels",
6+
"label": "Model list",
7+
"badge": "",
8+
"sourceCategoryId": "none",
9+
"featureLabels": [
10+
"All"
11+
],
12+
"model": "",
13+
"visible": true
14+
},
15+
{
16+
"id": "textGeneration",
17+
"label": "Text Generation",
18+
"badge": "",
19+
"sourceCategoryId": "text",
20+
"featureLabels": [
21+
"Thinking",
22+
"Attach files",
23+
"Web research",
24+
"Vision"
25+
],
26+
"model": "claude-opus-4-6",
27+
"visible": true
28+
},
29+
{
30+
"id": "imageCreation",
31+
"label": "Image Creation",
32+
"badge": "",
33+
"sourceCategoryId": "image",
34+
"featureLabels": [
35+
"Create Image",
36+
"Vision"
37+
],
38+
"model": "",
39+
"visible": false
40+
},
41+
{
42+
"id": "videoCreation",
43+
"label": "Video Creation",
44+
"badge": "",
45+
"sourceCategoryId": "image",
46+
"featureLabels": [
47+
"Create Video"
48+
],
49+
"model": "",
50+
"visible": false
51+
},
52+
{
53+
"id": "audioCreation",
54+
"label": "Audio creation",
55+
"badge": "",
56+
"sourceCategoryId": "audio",
57+
"featureLabels": [
58+
"Create Audio"
59+
],
60+
"model": "",
61+
"visible": false
62+
},
63+
{
64+
"id": "textToSpeech",
65+
"label": "Text to speech",
66+
"badge": "",
67+
"sourceCategoryId": "audio",
68+
"featureLabels": [
69+
"Text to speech"
70+
],
71+
"model": "",
72+
"visible": false
73+
},
74+
{
75+
"id": "deepResearch",
76+
"label": "Deep Research",
77+
"badge": "",
78+
"sourceCategoryId": "deepResearch",
79+
"featureLabels": [
80+
"Deep Research"
81+
],
82+
"model": "",
83+
"visible": false
84+
}
85+
],
86+
"type": "model-selector-set-runtime-config"
87+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"systemPrompt": {
3+
"systemPrompt": "",
4+
"enabled": false
5+
},
6+
"settings": {
7+
"temperature": 0.8,
8+
"maxToken": {
9+
"maxToken": 16000,
10+
"enabled": true
11+
},
12+
"stopString": {
13+
"stopString": [
14+
],
15+
"enabled": false
16+
}
17+
},
18+
"sampling": {
19+
"topK": {
20+
"topK": 20,
21+
"enabled": false
22+
},
23+
"presencePenalty": {
24+
"presencePenalty": 0,
25+
"enabled": false
26+
},
27+
"topP": {
28+
"topP": 0,
29+
"enabled": false
30+
},
31+
"seed": {
32+
"seed": 0,
33+
"enabled": false
34+
}
35+
},
36+
"structuredOutput": {
37+
"jsonSchema": "{\n \"type\": \"json_schema\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"email\": {\n \"type\": \"string\"\n },\n \"plan_interest\": {\n \"type\": \"string\"\n },\n \"demo_requested\": {\n \"type\": \"boolean\"\n }\n },\n \"required\": [\n \"name\",\n \"email\",\n \"plan_interest\",\n \"demo_requested\"\n ],\n \"additionalProperties\": false\n }\n}",
38+
"enabled": false
39+
},
40+
"vendorSettings": {
41+
"parallelToolCalls": false,
42+
"backgroundResponse": false,
43+
"usingPreviousId": false,
44+
"store": false
45+
},
46+
"type": "request-initialization"
47+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"type": "request-params-main-values",
3+
"look": "dark",
4+
"language": [
5+
"china-cn",
6+
"denmark-da",
7+
"dutch-nl",
8+
"english-gb",
9+
"english-us",
10+
"finland-fi",
11+
"french-ca",
12+
"french-fr",
13+
"german-de",
14+
"greece-gr",
15+
"italian-it",
16+
"japan-jp",
17+
"korea-kr",
18+
"norway-no",
19+
"polish-pl",
20+
"portugal-br",
21+
"portugal-pt",
22+
"spanish-es",
23+
"spanish-mx",
24+
"sweden-sv",
25+
"taiwan-tw",
26+
"turkey-tr",
27+
"ukraine-ua"
28+
],
29+
"selected": "french-fr",
30+
"scroll": true
31+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
name: delphi-uses-graph
3+
description: Analyzes a Delphi / Object Pascal codebase to extract unit-level `uses` dependencies. Use when the user uploads a zip / archive of a Delphi project (or a folder of .pas / .dpr / .dpk files) and asks for a dependency graph, architecture map, cycle detection, fan-in / fan-out coupling analysis, or wants to know how units relate. Produces a Mermaid diagram, a Graphviz DOT file, an SVG when graphviz is available, a JSON dump of the parsed graph, and a markdown report listing cycles, hotspots and orphan units.
4+
---
5+
6+
# Delphi uses-graph skill
7+
8+
This skill builds a directed graph of `uses` dependencies between Delphi /
9+
Object Pascal units, computes coupling metrics, and detects circular
10+
dependencies.
11+
12+
## When to use this skill
13+
14+
- The user uploads an archive (`.zip`, `.tar`, `.tar.gz`) containing a Delphi
15+
project, or a folder of `.pas` / `.dpr` / `.dpk` sources, and asks for an
16+
architecture map or a dependency graph.
17+
- The user asks "which unit depends on what?", "are there cycles?",
18+
"what's the fan-in / fan-out?" against a Delphi codebase.
19+
- The user wants a visual artifact (Mermaid embed, SVG, DOT) summarizing
20+
unit-level coupling.
21+
22+
Do **not** use this skill for non-Pascal codebases.
23+
24+
## Inputs
25+
26+
The skill expects exactly one of:
27+
28+
1. A `.zip` / `.tar` / `.tar.gz` archive of a Delphi project (preferred).
29+
2. A directory already containing `.pas`, `.dpr`, `.dpk` files.
30+
31+
If the user pastes raw Pascal source instead, persist it to one or more
32+
temporary `.pas` files first, then point `--input` at their parent directory.
33+
34+
## Workflow
35+
36+
1. Locate the input archive or directory in the working area.
37+
2. Run `scripts/tool.py` with `--input` pointing at it and `--output`
38+
pointing at a fresh subfolder of the working area.
39+
3. Read the generated `report.md` and summarize findings to the user:
40+
number of parsed units, top fan-in / fan-out, cycles, orphan units.
41+
4. Attach the produced artifacts (Mermaid, DOT, SVG when present, JSON,
42+
report) to the response. Embed `uses-graph.mmd` inline in the answer so
43+
the user sees the diagram rendered.
44+
45+
## Quick start
46+
47+
```bash
48+
python scripts/tool.py \
49+
--input /path/to/project.zip \
50+
--output /path/to/out
51+
```
52+
53+
Useful flags (full list in `reference.md`):
54+
55+
- `--scope {all,interface,implementation}` — which `uses` sections to
56+
consider. Default `all`.
57+
- `--ignore-prefix LIST` — drop edges whose target starts with one of these
58+
comma-separated prefixes, case-insensitive. Default
59+
`System,Winapi,Vcl,FMX,Data,Web,REST,IdGlobal`. Pass `""` to keep RTL/VCL.
60+
- `--max-label N` — truncate node labels in the Mermaid output (default 40).
61+
- `--include-orphans` — keep units that have no inbound and no outbound
62+
edges in the graph.
63+
64+
## Outputs (in `--output`)
65+
66+
| File | Purpose |
67+
| ------------------- | ---------------------------------------------------------------------------------------- |
68+
| `dependencies.json` | Raw graph: `{ unit: { defined_in, interface_uses, implementation_uses } }` |
69+
| `uses-graph.mmd` | Mermaid `graph LR` ready to embed in a markdown answer |
70+
| `uses-graph.dot` | Graphviz DOT source |
71+
| `uses-graph.svg` | SVG rendering — only when the `dot` binary is available on `PATH` |
72+
| `report.md` | Human-readable summary: counts, top hotspots, cycles, orphans |
73+
74+
## Notes
75+
76+
- RTL / VCL / FMX targets are filtered by default to keep the diagram
77+
readable. The user's own units are never filtered.
78+
- Cycle detection uses Tarjan's strongly connected components on the
79+
directed graph (edge `A -> B` means *A uses B*). Self-loops are reported
80+
separately.
81+
- Pascal `uses` syntax has several edge cases (dotted names, `in '<path>'`
82+
aliases, conditional defines, three comment styles). Read `reference.md`
83+
before changing the parser.
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# delphi-uses-graph — reference
2+
3+
Detailed reference for the parser, the output schema and the CLI of
4+
`scripts/tool.py`. Read this before modifying parsing rules.
5+
6+
## Pascal `uses` clause syntax
7+
8+
A unit may declare two `uses` clauses, one per section:
9+
10+
```pascal
11+
unit MyUnit;
12+
13+
interface
14+
15+
uses
16+
System.SysUtils, System.Classes, // dotted unit names
17+
Other.Unit in 'src\Other.Unit.pas'; // file alias
18+
19+
implementation
20+
21+
uses
22+
Helpers, {$IFDEF DEBUG} Logger {$ENDIF};
23+
```
24+
25+
A `program`, `library` or `package` file (`.dpr` / `.dpk`) carries a
26+
single `uses` clause that lists the units it pulls in. The skill treats
27+
that single clause as the program's `implementation_uses`.
28+
29+
## Parser rules
30+
31+
Implemented in `scripts/tool.py`:
32+
33+
1. **Strings** (`'...'`) are stripped first. A single quote is escaped as
34+
`''`.
35+
2. **Comments** are stripped next: `// ... <EOL>`, `{ ... }` and
36+
`(* ... *)`. Compiler directives such as `{$IFDEF DEBUG}` live inside
37+
`{ ... }` and are also stripped — their payload is never material to
38+
the `uses` graph.
39+
3. **Stripped regions are replaced with spaces**, not removed. Byte
40+
offsets stay aligned with the original source so positional checks
41+
(`interface` vs `implementation`) remain accurate.
42+
4. **Keywords** (`unit`, `program`, `library`, `package`, `interface`,
43+
`implementation`, `uses`) are matched case-insensitively.
44+
5. **Unit name** comes from `unit <Name>;` if present, otherwise from
45+
`program | library | package <Name>`. As a last resort it falls back
46+
to the file stem.
47+
6. **`uses` clauses** run from the keyword `uses` to the next `;`. Items
48+
are split on commas. Each item may carry an `in '<path>'` alias —
49+
only the unit name is kept, the alias is dropped.
50+
7. **Section assignment**: a `uses` clause appearing before
51+
`implementation` and at or after `interface` is filed under
52+
`interface_uses`. A clause at or after `implementation` is filed
53+
under `implementation_uses`. For program / library / package files
54+
that have neither keyword, the clause is filed under
55+
`implementation_uses` so it still contributes to the graph.
56+
57+
## Output schema (`dependencies.json`)
58+
59+
```json
60+
{
61+
"MyUnit": {
62+
"defined_in": "src/MyUnit.pas",
63+
"interface_uses": ["System.SysUtils", "Other.Unit"],
64+
"implementation_uses": ["Helpers"]
65+
}
66+
}
67+
```
68+
69+
Paths in `defined_in` are relative to the input root when possible,
70+
absolute otherwise.
71+
72+
## Graph model
73+
74+
- **Nodes** are unit names. A node is *internal* if at least one source
75+
file defined it, *external* otherwise (typically RTL / third-party).
76+
- **Edges** are directed: `A -> B` means *A uses B*.
77+
- The `--scope` flag controls which `uses` clauses contribute edges
78+
(`interface`, `implementation` or both — default `all`).
79+
- The `--ignore-prefix` flag removes edges whose target starts with any
80+
of the given prefixes (case-insensitive, dotted boundary). Internal
81+
units are never removed by this filter.
82+
83+
## Cycle detection
84+
85+
Tarjan's strongly connected components is run over the directed graph.
86+
87+
- Components of size > 1 are reported as cycles in `report.md`.
88+
- Self-loops (`A -> A`, rare but legal via mutual `interface` /
89+
`implementation` patterns of the same name) are reported separately.
90+
91+
## CLI flags
92+
93+
| Flag | Default | Purpose |
94+
| --------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------ |
95+
| `--input PATH` | required | Zip / tar archive or directory containing `.pas` / `.dpr` / `.dpk` |
96+
| `--output DIR` | required | Where artifacts are written (created if missing) |
97+
| `--scope` | `all` | `interface`, `implementation`, or `all` |
98+
| `--ignore-prefix STR` | `System,Winapi,Vcl,FMX,Data,Web,REST,IdGlobal` | Comma-separated prefixes filtered from edges. Pass `""` to keep RTL / VCL targets. |
99+
| `--max-label N` | `40` | Truncate node labels in the Mermaid output |
100+
| `--include-orphans` | off | Keep units with no inbound and no outbound edges |
101+
102+
## Optional SVG rendering
103+
104+
If the `dot` binary is on `PATH`, the script invokes it to produce
105+
`uses-graph.svg`. If absent, the SVG step is skipped and a note is added
106+
to `report.md`. The `.dot` source is always written so the user can
107+
render it later.
108+
109+
## Limitations
110+
111+
- `{$INCLUDE ...}` directives are not expanded — only the file that
112+
contains the directive is parsed.
113+
- Conditional sections enclosed by `{$IFDEF X} ... {$ELSE} ... {$ENDIF}`
114+
are stripped along with the directive comment, so units used only
115+
under a specific symbol are not currently distinguished.
116+
- Generic / namespace aliasing inside `uses` (rare) is not modeled.

0 commit comments

Comments
 (0)