sacpaint 0.2.0__py3-none-any.whl
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.
- sacpaint/__init__.py +28 -0
- sacpaint/assets/sacramento-line-v0.json +97 -0
- sacpaint/assets/sacramento-line-v0.png +0 -0
- sacpaint/assets/sacramento-line-v0.spec.json +531 -0
- sacpaint/claude_shim/__init__.py +45 -0
- sacpaint/claude_shim/__main__.py +80 -0
- sacpaint/claude_shim/server.py +357 -0
- sacpaint/claude_shim/translate.py +580 -0
- sacpaint/cli.py +511 -0
- sacpaint/mock.py +254 -0
- sacpaint/opencastor/__init__.py +52 -0
- sacpaint/opencastor/calibrate.py +180 -0
- sacpaint/opencastor/calibration.py +305 -0
- sacpaint/opencastor/cameras.py +378 -0
- sacpaint/opencastor/client.py +514 -0
- sacpaint/opencastor/embodiment.py +606 -0
- sacpaint/rectify.py +171 -0
- sacpaint/reference.py +379 -0
- sacpaint/scorers.py +414 -0
- sacpaint/tasks.py +94 -0
- sacpaint-0.2.0.dist-info/METADATA +229 -0
- sacpaint-0.2.0.dist-info/RECORD +25 -0
- sacpaint-0.2.0.dist-info/WHEEL +5 -0
- sacpaint-0.2.0.dist-info/entry_points.txt +19 -0
- sacpaint-0.2.0.dist-info/top_level.txt +1 -0
sacpaint/__init__.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Sacramento PaintBench: an Inspect Robots benchmark.
|
|
2
|
+
|
|
3
|
+
The task is one sentence: draw the fixed reference image on the canvas, using
|
|
4
|
+
the camera to inspect and correct, and stop when done. The built-in reference
|
|
5
|
+
is a deliberately simplified Sacramento composition (Tower Bridge above the
|
|
6
|
+
Capitol dome, joined by the Capitol Mall); any ``.spec.json`` of strokes makes
|
|
7
|
+
another. Scoring is geometric, not aesthetic: each landmark must be present,
|
|
8
|
+
in the right place, in the right relation to the others.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from sacpaint.reference import DEFAULT_REFERENCE, ReferenceSpec, available, canonical_size, get_spec, load_rubric, reference_image
|
|
12
|
+
from sacpaint.scorers import composite, discipline, efficiency, landmark_geometry, score_canvas, structure
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"DEFAULT_REFERENCE",
|
|
16
|
+
"ReferenceSpec",
|
|
17
|
+
"available",
|
|
18
|
+
"canonical_size",
|
|
19
|
+
"composite",
|
|
20
|
+
"discipline",
|
|
21
|
+
"efficiency",
|
|
22
|
+
"get_spec",
|
|
23
|
+
"landmark_geometry",
|
|
24
|
+
"load_rubric",
|
|
25
|
+
"reference_image",
|
|
26
|
+
"score_canvas",
|
|
27
|
+
"structure",
|
|
28
|
+
]
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"canvas_mm": [
|
|
3
|
+
150.0,
|
|
4
|
+
200.0
|
|
5
|
+
],
|
|
6
|
+
"discipline_band_frac": 0.025,
|
|
7
|
+
"ink_threshold": 128,
|
|
8
|
+
"landmark_tolerance_frac": 0.01,
|
|
9
|
+
"landmarks": {
|
|
10
|
+
"buildings": {
|
|
11
|
+
"bbox": [
|
|
12
|
+
0.0133,
|
|
13
|
+
0.335,
|
|
14
|
+
0.9867,
|
|
15
|
+
0.765
|
|
16
|
+
],
|
|
17
|
+
"weight": 1
|
|
18
|
+
},
|
|
19
|
+
"capitol_dome": {
|
|
20
|
+
"bbox": [
|
|
21
|
+
0.2467,
|
|
22
|
+
0.66,
|
|
23
|
+
0.7533,
|
|
24
|
+
0.865
|
|
25
|
+
],
|
|
26
|
+
"weight": 3
|
|
27
|
+
},
|
|
28
|
+
"cupola": {
|
|
29
|
+
"bbox": [
|
|
30
|
+
0.43,
|
|
31
|
+
0.52,
|
|
32
|
+
0.57,
|
|
33
|
+
0.69
|
|
34
|
+
],
|
|
35
|
+
"weight": 1
|
|
36
|
+
},
|
|
37
|
+
"horizon": {
|
|
38
|
+
"bbox": [
|
|
39
|
+
0.0,
|
|
40
|
+
0.235,
|
|
41
|
+
1.0,
|
|
42
|
+
0.265
|
|
43
|
+
],
|
|
44
|
+
"weight": 1
|
|
45
|
+
},
|
|
46
|
+
"road": {
|
|
47
|
+
"bbox": [
|
|
48
|
+
0.3533,
|
|
49
|
+
0.4725,
|
|
50
|
+
0.6467,
|
|
51
|
+
0.665
|
|
52
|
+
],
|
|
53
|
+
"weight": 2
|
|
54
|
+
},
|
|
55
|
+
"tower_bridge": {
|
|
56
|
+
"bbox": [
|
|
57
|
+
0.38,
|
|
58
|
+
0.24,
|
|
59
|
+
0.62,
|
|
60
|
+
0.5025
|
|
61
|
+
],
|
|
62
|
+
"weight": 3
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"px_per_mm": 4.0,
|
|
66
|
+
"relations": [
|
|
67
|
+
{
|
|
68
|
+
"a": "tower_bridge",
|
|
69
|
+
"b": "capitol_dome",
|
|
70
|
+
"kind": "same_x",
|
|
71
|
+
"tolerance": 0.05
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"a": "tower_bridge",
|
|
75
|
+
"b": "capitol_dome",
|
|
76
|
+
"kind": "above"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"a": "cupola",
|
|
80
|
+
"b": "capitol_dome",
|
|
81
|
+
"kind": "above"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"a": "horizon",
|
|
85
|
+
"b": "tower_bridge",
|
|
86
|
+
"kind": "above"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"structure_tolerance_frac": 0.02,
|
|
90
|
+
"version": "sacramento-line-v0",
|
|
91
|
+
"weights": {
|
|
92
|
+
"discipline": 0.15,
|
|
93
|
+
"efficiency": 0.1,
|
|
94
|
+
"landmark_geometry": 0.45,
|
|
95
|
+
"structure": 0.3
|
|
96
|
+
}
|
|
97
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bbox_pad_mm": 3.0,
|
|
3
|
+
"canvas_mm": [
|
|
4
|
+
150.0,
|
|
5
|
+
200.0
|
|
6
|
+
],
|
|
7
|
+
"description": "Sacramento: Tower Bridge above the Capitol dome and cupola, the Capitol Mall between them, two building masses, a horizon.",
|
|
8
|
+
"discipline_band_frac": 0.025,
|
|
9
|
+
"instruction": null,
|
|
10
|
+
"landmark_tolerance_frac": 0.01,
|
|
11
|
+
"landmarks": {
|
|
12
|
+
"buildings": {
|
|
13
|
+
"bbox_mm": [
|
|
14
|
+
2.0,
|
|
15
|
+
47.0,
|
|
16
|
+
148.0,
|
|
17
|
+
133.0
|
|
18
|
+
],
|
|
19
|
+
"weight": 1
|
|
20
|
+
},
|
|
21
|
+
"canopy": {
|
|
22
|
+
"score": false
|
|
23
|
+
},
|
|
24
|
+
"capitol_dome": {
|
|
25
|
+
"bbox_mm": [
|
|
26
|
+
37.0,
|
|
27
|
+
27.0,
|
|
28
|
+
113.0,
|
|
29
|
+
68.0
|
|
30
|
+
],
|
|
31
|
+
"weight": 3
|
|
32
|
+
},
|
|
33
|
+
"cupola": {
|
|
34
|
+
"bbox_mm": [
|
|
35
|
+
64.5,
|
|
36
|
+
62.0,
|
|
37
|
+
85.5,
|
|
38
|
+
96.0
|
|
39
|
+
],
|
|
40
|
+
"weight": 1
|
|
41
|
+
},
|
|
42
|
+
"horizon": {
|
|
43
|
+
"bbox_mm": [
|
|
44
|
+
0.0,
|
|
45
|
+
147.0,
|
|
46
|
+
150.0,
|
|
47
|
+
153.0
|
|
48
|
+
],
|
|
49
|
+
"weight": 1
|
|
50
|
+
},
|
|
51
|
+
"road": {
|
|
52
|
+
"bbox_mm": [
|
|
53
|
+
53.0,
|
|
54
|
+
67.0,
|
|
55
|
+
97.0,
|
|
56
|
+
105.5
|
|
57
|
+
],
|
|
58
|
+
"weight": 2
|
|
59
|
+
},
|
|
60
|
+
"tower_bridge": {
|
|
61
|
+
"bbox_mm": [
|
|
62
|
+
57.0,
|
|
63
|
+
99.5,
|
|
64
|
+
93.0,
|
|
65
|
+
152.0
|
|
66
|
+
],
|
|
67
|
+
"weight": 3
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"name": "sacramento-line-v0",
|
|
71
|
+
"px_per_mm": 4.0,
|
|
72
|
+
"relations": [
|
|
73
|
+
{
|
|
74
|
+
"a": "tower_bridge",
|
|
75
|
+
"b": "capitol_dome",
|
|
76
|
+
"kind": "same_x",
|
|
77
|
+
"tolerance": 0.05
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"a": "tower_bridge",
|
|
81
|
+
"b": "capitol_dome",
|
|
82
|
+
"kind": "above"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"a": "cupola",
|
|
86
|
+
"b": "capitol_dome",
|
|
87
|
+
"kind": "above"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"a": "horizon",
|
|
91
|
+
"b": "tower_bridge",
|
|
92
|
+
"kind": "above"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"stroke_px": 3,
|
|
96
|
+
"strokes": {
|
|
97
|
+
"buildings": [
|
|
98
|
+
[
|
|
99
|
+
[
|
|
100
|
+
5.0,
|
|
101
|
+
50.0
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
35.0,
|
|
105
|
+
50.0
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
35.0,
|
|
109
|
+
130.0
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
5.0,
|
|
113
|
+
130.0
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
5.0,
|
|
117
|
+
50.0
|
|
118
|
+
]
|
|
119
|
+
],
|
|
120
|
+
[
|
|
121
|
+
[
|
|
122
|
+
115.0,
|
|
123
|
+
50.0
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
145.0,
|
|
127
|
+
50.0
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
145.0,
|
|
131
|
+
125.0
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
115.0,
|
|
135
|
+
125.0
|
|
136
|
+
],
|
|
137
|
+
[
|
|
138
|
+
115.0,
|
|
139
|
+
50.0
|
|
140
|
+
]
|
|
141
|
+
]
|
|
142
|
+
],
|
|
143
|
+
"canopy": [
|
|
144
|
+
[
|
|
145
|
+
[
|
|
146
|
+
37.5,
|
|
147
|
+
100.0
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
62.5,
|
|
151
|
+
100.0
|
|
152
|
+
]
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
[
|
|
156
|
+
87.5,
|
|
157
|
+
100.0
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
112.5,
|
|
161
|
+
100.0
|
|
162
|
+
]
|
|
163
|
+
]
|
|
164
|
+
],
|
|
165
|
+
"capitol_dome": [
|
|
166
|
+
[
|
|
167
|
+
[
|
|
168
|
+
110.0,
|
|
169
|
+
30.0
|
|
170
|
+
],
|
|
171
|
+
[
|
|
172
|
+
109.67400811127158,
|
|
173
|
+
34.76583271836863
|
|
174
|
+
],
|
|
175
|
+
[
|
|
176
|
+
108.70210505717297,
|
|
177
|
+
39.44288699049585
|
|
178
|
+
],
|
|
179
|
+
[
|
|
180
|
+
107.10239555269087,
|
|
181
|
+
43.94403814461845
|
|
182
|
+
],
|
|
183
|
+
[
|
|
184
|
+
104.9046791591271,
|
|
185
|
+
48.18543825124017
|
|
186
|
+
],
|
|
187
|
+
[
|
|
188
|
+
102.14989517465469,
|
|
189
|
+
52.08807805141184
|
|
190
|
+
],
|
|
191
|
+
[
|
|
192
|
+
98.88936001265289,
|
|
193
|
+
55.57925874973434
|
|
194
|
+
],
|
|
195
|
+
[
|
|
196
|
+
95.18381127402036,
|
|
197
|
+
58.593946255365466
|
|
198
|
+
],
|
|
199
|
+
[
|
|
200
|
+
91.10227632059033,
|
|
201
|
+
61.07598264408313
|
|
202
|
+
],
|
|
203
|
+
[
|
|
204
|
+
86.72078642598451,
|
|
205
|
+
62.979132274158715
|
|
206
|
+
],
|
|
207
|
+
[
|
|
208
|
+
82.12096045684218,
|
|
209
|
+
64.2679430688813
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
77.38848446776349,
|
|
213
|
+
64.91840692166886
|
|
214
|
+
],
|
|
215
|
+
[
|
|
216
|
+
72.61151553223651,
|
|
217
|
+
64.91840692166886
|
|
218
|
+
],
|
|
219
|
+
[
|
|
220
|
+
67.87903954315782,
|
|
221
|
+
64.2679430688813
|
|
222
|
+
],
|
|
223
|
+
[
|
|
224
|
+
63.279213574015486,
|
|
225
|
+
62.979132274158715
|
|
226
|
+
],
|
|
227
|
+
[
|
|
228
|
+
58.89772367940968,
|
|
229
|
+
61.07598264408313
|
|
230
|
+
],
|
|
231
|
+
[
|
|
232
|
+
54.81618872597966,
|
|
233
|
+
58.59394625536547
|
|
234
|
+
],
|
|
235
|
+
[
|
|
236
|
+
51.11063998734711,
|
|
237
|
+
55.57925874973435
|
|
238
|
+
],
|
|
239
|
+
[
|
|
240
|
+
47.850104825345305,
|
|
241
|
+
52.08807805141184
|
|
242
|
+
],
|
|
243
|
+
[
|
|
244
|
+
45.09532084087291,
|
|
245
|
+
48.185438251240186
|
|
246
|
+
],
|
|
247
|
+
[
|
|
248
|
+
42.89760444730914,
|
|
249
|
+
43.944038144618446
|
|
250
|
+
],
|
|
251
|
+
[
|
|
252
|
+
41.29789494282703,
|
|
253
|
+
39.44288699049585
|
|
254
|
+
],
|
|
255
|
+
[
|
|
256
|
+
40.325991888728424,
|
|
257
|
+
34.765832718368635
|
|
258
|
+
],
|
|
259
|
+
[
|
|
260
|
+
40.0,
|
|
261
|
+
30.000000000000004
|
|
262
|
+
]
|
|
263
|
+
],
|
|
264
|
+
[
|
|
265
|
+
[
|
|
266
|
+
40.0,
|
|
267
|
+
30.0
|
|
268
|
+
],
|
|
269
|
+
[
|
|
270
|
+
110.0,
|
|
271
|
+
30.0
|
|
272
|
+
]
|
|
273
|
+
]
|
|
274
|
+
],
|
|
275
|
+
"cupola": [
|
|
276
|
+
[
|
|
277
|
+
[
|
|
278
|
+
67.5,
|
|
279
|
+
65.0
|
|
280
|
+
],
|
|
281
|
+
[
|
|
282
|
+
82.5,
|
|
283
|
+
65.0
|
|
284
|
+
],
|
|
285
|
+
[
|
|
286
|
+
82.5,
|
|
287
|
+
82.5
|
|
288
|
+
],
|
|
289
|
+
[
|
|
290
|
+
67.5,
|
|
291
|
+
82.5
|
|
292
|
+
],
|
|
293
|
+
[
|
|
294
|
+
67.5,
|
|
295
|
+
65.0
|
|
296
|
+
]
|
|
297
|
+
],
|
|
298
|
+
[
|
|
299
|
+
[
|
|
300
|
+
79.0,
|
|
301
|
+
89.0
|
|
302
|
+
],
|
|
303
|
+
[
|
|
304
|
+
78.78326896680254,
|
|
305
|
+
90.29879787681874
|
|
306
|
+
],
|
|
307
|
+
[
|
|
308
|
+
78.15656203758557,
|
|
309
|
+
91.45685085075867
|
|
310
|
+
],
|
|
311
|
+
[
|
|
312
|
+
77.1877926324897,
|
|
313
|
+
92.34866591305011
|
|
314
|
+
],
|
|
315
|
+
[
|
|
316
|
+
75.9819419485632,
|
|
317
|
+
92.87760106375733
|
|
318
|
+
],
|
|
319
|
+
[
|
|
320
|
+
74.66968261811067,
|
|
321
|
+
92.98633797202667
|
|
322
|
+
],
|
|
323
|
+
[
|
|
324
|
+
73.39321830138812,
|
|
325
|
+
92.66309330662023
|
|
326
|
+
],
|
|
327
|
+
[
|
|
328
|
+
72.29087371349704,
|
|
329
|
+
91.94289564269253
|
|
330
|
+
],
|
|
331
|
+
[
|
|
332
|
+
71.48210499517404,
|
|
333
|
+
90.9037895721483
|
|
334
|
+
],
|
|
335
|
+
[
|
|
336
|
+
71.0545547863891,
|
|
337
|
+
89.65837836112294
|
|
338
|
+
],
|
|
339
|
+
[
|
|
340
|
+
71.0545547863891,
|
|
341
|
+
88.34162163887706
|
|
342
|
+
],
|
|
343
|
+
[
|
|
344
|
+
71.48210499517404,
|
|
345
|
+
87.0962104278517
|
|
346
|
+
],
|
|
347
|
+
[
|
|
348
|
+
72.29087371349704,
|
|
349
|
+
86.05710435730748
|
|
350
|
+
],
|
|
351
|
+
[
|
|
352
|
+
73.39321830138812,
|
|
353
|
+
85.33690669337977
|
|
354
|
+
],
|
|
355
|
+
[
|
|
356
|
+
74.66968261811067,
|
|
357
|
+
85.01366202797333
|
|
358
|
+
],
|
|
359
|
+
[
|
|
360
|
+
75.98194194856319,
|
|
361
|
+
85.12239893624267
|
|
362
|
+
],
|
|
363
|
+
[
|
|
364
|
+
77.1877926324897,
|
|
365
|
+
85.65133408694989
|
|
366
|
+
],
|
|
367
|
+
[
|
|
368
|
+
78.15656203758557,
|
|
369
|
+
86.54314914924133
|
|
370
|
+
],
|
|
371
|
+
[
|
|
372
|
+
78.78326896680254,
|
|
373
|
+
87.70120212318126
|
|
374
|
+
],
|
|
375
|
+
[
|
|
376
|
+
79.0,
|
|
377
|
+
89.0
|
|
378
|
+
]
|
|
379
|
+
],
|
|
380
|
+
[
|
|
381
|
+
[
|
|
382
|
+
75.0,
|
|
383
|
+
82.5
|
|
384
|
+
],
|
|
385
|
+
[
|
|
386
|
+
75.0,
|
|
387
|
+
85.0
|
|
388
|
+
]
|
|
389
|
+
]
|
|
390
|
+
],
|
|
391
|
+
"horizon": [
|
|
392
|
+
[
|
|
393
|
+
[
|
|
394
|
+
0.0,
|
|
395
|
+
150.0
|
|
396
|
+
],
|
|
397
|
+
[
|
|
398
|
+
150.0,
|
|
399
|
+
150.0
|
|
400
|
+
]
|
|
401
|
+
]
|
|
402
|
+
],
|
|
403
|
+
"road": [
|
|
404
|
+
[
|
|
405
|
+
[
|
|
406
|
+
56.0,
|
|
407
|
+
70.0
|
|
408
|
+
],
|
|
409
|
+
[
|
|
410
|
+
70.0,
|
|
411
|
+
102.5
|
|
412
|
+
]
|
|
413
|
+
],
|
|
414
|
+
[
|
|
415
|
+
[
|
|
416
|
+
94.0,
|
|
417
|
+
70.0
|
|
418
|
+
],
|
|
419
|
+
[
|
|
420
|
+
80.0,
|
|
421
|
+
102.5
|
|
422
|
+
]
|
|
423
|
+
]
|
|
424
|
+
],
|
|
425
|
+
"tower_bridge": [
|
|
426
|
+
[
|
|
427
|
+
[
|
|
428
|
+
62.5,
|
|
429
|
+
102.5
|
|
430
|
+
],
|
|
431
|
+
[
|
|
432
|
+
87.5,
|
|
433
|
+
102.5
|
|
434
|
+
],
|
|
435
|
+
[
|
|
436
|
+
87.5,
|
|
437
|
+
145.0
|
|
438
|
+
],
|
|
439
|
+
[
|
|
440
|
+
62.5,
|
|
441
|
+
145.0
|
|
442
|
+
],
|
|
443
|
+
[
|
|
444
|
+
62.5,
|
|
445
|
+
102.5
|
|
446
|
+
]
|
|
447
|
+
],
|
|
448
|
+
[
|
|
449
|
+
[
|
|
450
|
+
60.0,
|
|
451
|
+
145.0
|
|
452
|
+
],
|
|
453
|
+
[
|
|
454
|
+
90.0,
|
|
455
|
+
145.0
|
|
456
|
+
],
|
|
457
|
+
[
|
|
458
|
+
90.0,
|
|
459
|
+
149.0
|
|
460
|
+
],
|
|
461
|
+
[
|
|
462
|
+
60.0,
|
|
463
|
+
149.0
|
|
464
|
+
],
|
|
465
|
+
[
|
|
466
|
+
60.0,
|
|
467
|
+
145.0
|
|
468
|
+
]
|
|
469
|
+
],
|
|
470
|
+
[
|
|
471
|
+
[
|
|
472
|
+
62.5,
|
|
473
|
+
123.75
|
|
474
|
+
],
|
|
475
|
+
[
|
|
476
|
+
87.5,
|
|
477
|
+
123.75
|
|
478
|
+
]
|
|
479
|
+
],
|
|
480
|
+
[
|
|
481
|
+
[
|
|
482
|
+
62.5,
|
|
483
|
+
102.5
|
|
484
|
+
],
|
|
485
|
+
[
|
|
486
|
+
87.5,
|
|
487
|
+
123.75
|
|
488
|
+
]
|
|
489
|
+
],
|
|
490
|
+
[
|
|
491
|
+
[
|
|
492
|
+
87.5,
|
|
493
|
+
102.5
|
|
494
|
+
],
|
|
495
|
+
[
|
|
496
|
+
62.5,
|
|
497
|
+
123.75
|
|
498
|
+
]
|
|
499
|
+
],
|
|
500
|
+
[
|
|
501
|
+
[
|
|
502
|
+
70.0,
|
|
503
|
+
102.5
|
|
504
|
+
],
|
|
505
|
+
[
|
|
506
|
+
80.0,
|
|
507
|
+
102.5
|
|
508
|
+
],
|
|
509
|
+
[
|
|
510
|
+
80.0,
|
|
511
|
+
112.5
|
|
512
|
+
],
|
|
513
|
+
[
|
|
514
|
+
70.0,
|
|
515
|
+
112.5
|
|
516
|
+
],
|
|
517
|
+
[
|
|
518
|
+
70.0,
|
|
519
|
+
102.5
|
|
520
|
+
]
|
|
521
|
+
]
|
|
522
|
+
]
|
|
523
|
+
},
|
|
524
|
+
"structure_tolerance_frac": 0.02,
|
|
525
|
+
"weights": {
|
|
526
|
+
"discipline": 0.15,
|
|
527
|
+
"efficiency": 0.1,
|
|
528
|
+
"landmark_geometry": 0.45,
|
|
529
|
+
"structure": 0.3
|
|
530
|
+
}
|
|
531
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""OpenAI/Anthropic-compatible localhost endpoint backed by the Claude Code CLI.
|
|
2
|
+
|
|
3
|
+
Lets a tool that only speaks HTTP to an LLM API — ``inspect-robots
|
|
4
|
+
--policy agent``, for instance — run on the owner's Claude subscription
|
|
5
|
+
instead of a metered API key.
|
|
6
|
+
|
|
7
|
+
Results produced this way go through Claude Code's own harness and system
|
|
8
|
+
prompt, so they carry the ``claude-code-cli`` wire label and are not
|
|
9
|
+
comparable to raw-API runs. See ``docs/subscription.md``.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from sacpaint.claude_shim.server import ClaudeCLIError, ClaudeRunner, make_server, serve
|
|
13
|
+
from sacpaint.claude_shim.translate import (
|
|
14
|
+
WIRE_LABEL,
|
|
15
|
+
Prepared,
|
|
16
|
+
TranslationError,
|
|
17
|
+
anthropic_response,
|
|
18
|
+
anthropic_to_chat_body,
|
|
19
|
+
chat_response,
|
|
20
|
+
extract_tool_call,
|
|
21
|
+
prepare,
|
|
22
|
+
render_conversation,
|
|
23
|
+
tool_instruction,
|
|
24
|
+
tool_schema,
|
|
25
|
+
usage_from_envelope,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"WIRE_LABEL",
|
|
30
|
+
"ClaudeCLIError",
|
|
31
|
+
"ClaudeRunner",
|
|
32
|
+
"Prepared",
|
|
33
|
+
"TranslationError",
|
|
34
|
+
"anthropic_response",
|
|
35
|
+
"anthropic_to_chat_body",
|
|
36
|
+
"chat_response",
|
|
37
|
+
"extract_tool_call",
|
|
38
|
+
"make_server",
|
|
39
|
+
"prepare",
|
|
40
|
+
"render_conversation",
|
|
41
|
+
"serve",
|
|
42
|
+
"tool_instruction",
|
|
43
|
+
"tool_schema",
|
|
44
|
+
"usage_from_envelope",
|
|
45
|
+
]
|