oscar-solidcraft 0.1.0__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.
- oscar_solidcraft-0.1.0/.gitignore +11 -0
- oscar_solidcraft-0.1.0/CHANGELOG.md +36 -0
- oscar_solidcraft-0.1.0/LICENSE +202 -0
- oscar_solidcraft-0.1.0/NOTICE +29 -0
- oscar_solidcraft-0.1.0/PKG-INFO +355 -0
- oscar_solidcraft-0.1.0/README.md +332 -0
- oscar_solidcraft-0.1.0/SECURITY.md +60 -0
- oscar_solidcraft-0.1.0/docs/architecture.md +202 -0
- oscar_solidcraft-0.1.0/pyproject.toml +48 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/__init__.py +6 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/__main__.py +8 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/acp.py +554 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/__init__.py +41 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/account.py +338 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/config.py +187 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/device.py +213 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/discovery.py +165 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/keystore.py +821 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/loopback.py +527 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/pkce.py +52 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/session.py +445 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/auth/transport.py +408 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/browser.py +102 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/cli.py +209 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/context_guard.py +85 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/conversation.py +319 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/doctrine/solidcraft_assistant.md +91 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/doctrine.py +66 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/errors.py +96 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/fsretry.py +33 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/gateway.py +579 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/identity.py +110 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/jsonrpc.py +390 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/logs.py +182 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/mcp.py +288 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/status.py +158 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/threads.py +44 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/tools.py +277 -0
- oscar_solidcraft-0.1.0/src/oscar_solidcraft/turn.py +354 -0
- oscar_solidcraft-0.1.0/tests/conftest.py +13 -0
- oscar_solidcraft-0.1.0/tests/support/__init__.py +0 -0
- oscar_solidcraft-0.1.0/tests/support/acceptance.py +558 -0
- oscar_solidcraft-0.1.0/tests/support/acp_client.py +136 -0
- oscar_solidcraft-0.1.0/tests/support/fake_browser.py +38 -0
- oscar_solidcraft-0.1.0/tests/support/fake_mcp.py +183 -0
- oscar_solidcraft-0.1.0/tests/support/fake_originshape.py +1246 -0
- oscar_solidcraft-0.1.0/tests/support/isolation.py +43 -0
- oscar_solidcraft-0.1.0/tests/test_acceptance_headless.py +45 -0
- oscar_solidcraft-0.1.0/tests/test_acp_e2e.py +463 -0
- oscar_solidcraft-0.1.0/tests/test_acp_sessions.py +180 -0
- oscar_solidcraft-0.1.0/tests/test_auth_basics.py +580 -0
- oscar_solidcraft-0.1.0/tests/test_auth_device.py +288 -0
- oscar_solidcraft-0.1.0/tests/test_auth_fake.py +453 -0
- oscar_solidcraft-0.1.0/tests/test_auth_keystore.py +756 -0
- oscar_solidcraft-0.1.0/tests/test_auth_loopback.py +506 -0
- oscar_solidcraft-0.1.0/tests/test_auth_redaction.py +282 -0
- oscar_solidcraft-0.1.0/tests/test_auth_session.py +606 -0
- oscar_solidcraft-0.1.0/tests/test_clarify_headless.py +336 -0
- oscar_solidcraft-0.1.0/tests/test_cli.py +102 -0
- oscar_solidcraft-0.1.0/tests/test_conversation.py +207 -0
- oscar_solidcraft-0.1.0/tests/test_doctrine.py +114 -0
- oscar_solidcraft-0.1.0/tests/test_errors.py +64 -0
- oscar_solidcraft-0.1.0/tests/test_gateway.py +323 -0
- oscar_solidcraft-0.1.0/tests/test_guardrails.py +175 -0
- oscar_solidcraft-0.1.0/tests/test_heartbeat.py +285 -0
- oscar_solidcraft-0.1.0/tests/test_jsonrpc.py +285 -0
- oscar_solidcraft-0.1.0/tests/test_mcp.py +204 -0
- oscar_solidcraft-0.1.0/tests/test_parameters_headless.py +332 -0
- oscar_solidcraft-0.1.0/tests/test_solidcraft_all_tools.py +187 -0
- oscar_solidcraft-0.1.0/tests/test_solidcraft_real.py +101 -0
- oscar_solidcraft-0.1.0/tests/test_status.py +127 -0
- oscar_solidcraft-0.1.0/tests/test_tools.py +162 -0
- oscar_solidcraft-0.1.0/tests/test_turn.py +315 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- While a chat is open, Oscar checks in with OriginShape every 45 seconds (`GET /v1/me`), so the website's
|
|
6
|
+
Integrations page shows SolidCraft as **Running** for as long as Oscar is connected, not only while it is answering.
|
|
7
|
+
The same call keeps the credits under the Connect button current, and shows "Not signed in" within a minute when the
|
|
8
|
+
sign-in is revoked on the website.
|
|
9
|
+
|
|
10
|
+
## 0.1.0 (2026-10-29)
|
|
11
|
+
|
|
12
|
+
First release.
|
|
13
|
+
|
|
14
|
+
- An Agent Client Protocol agent for SolidCraft 0.26's Assistant panel: `initialize`, `authenticate`, `logout`,
|
|
15
|
+
`session/new`, `session/prompt`, `session/cancel`, `session/set_model`, `session/set_config_option` and
|
|
16
|
+
`session/set_mode`, over newline-delimited JSON-RPC on stdin/stdout.
|
|
17
|
+
- Sign in to OriginShape with the browser (the panel's **Sign in with OriginShape** button) or with a code
|
|
18
|
+
(`oscar-solidcraft login --device`); the sign-in is kept in the system keychain as "Oscar for SolidCraft" and shared
|
|
19
|
+
safely by every SolidCraft design tab. `oscar-solidcraft login`, `logout` and `status` in a terminal.
|
|
20
|
+
- Uses the MCP tool server SolidCraft hands over (`solidcraft-app`): tool cards with SolidCraft's titles, calls one at
|
|
21
|
+
a time with a 6-minute limit, cancellation that reaches the tool server.
|
|
22
|
+
- Streams text and short summaries of its reasoning as they arrive, through OriginShape's metered gateway (Origin1
|
|
23
|
+
and Origin1 Super), with prompt caching, a picture budget, retries for network trouble, and clear messages for
|
|
24
|
+
credits, approval, rate limits and an outdated version.
|
|
25
|
+
- Keeps the conversation append-only so the model's signed thinking stays valid: old pictures are pruned only when a
|
|
26
|
+
new message starts (thinking is cleared with them), and a round refused for a stale thinking signature (for example
|
|
27
|
+
after OriginShape updates Oscar's instructions) is retried once without thinking.
|
|
28
|
+
- Shows `you@example.com · N credits` under the panel's Connect button (plus the server's name when it is not
|
|
29
|
+
OriginShape's own), and writes `signed-in.json` so SolidCraft can tell a sign-in exists.
|
|
30
|
+
- Guards against a runaway message: at most 60 model calls, 200,000 output tokens and six retries per message, and it
|
|
31
|
+
stops when the same tool is asked the same thing a third time without the design changing.
|
|
32
|
+
- Treats what it receives as untrusted: size, count and nesting limits on SolidCraft's messages, prompts, tool lists
|
|
33
|
+
and tool results; pictures and PDFs checked before they enter the conversation; a sign-in listener that answers only
|
|
34
|
+
its own callback; a sign-in kept only for the server that issued it; private (0700/0600) files; a log scrubbed of
|
|
35
|
+
tokens, URL secrets and email addresses; nothing but JSON-RPC on stdout and no tracebacks on stderr. `SECURITY.md`
|
|
36
|
+
says what it stores and sends.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Oscar for SolidCraft
|
|
2
|
+
Copyright 2026 OriginShape
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
Portions are adapted from Oscar for FreeCAD (https://github.com/Originshape/Oscar-Freecad, Apache-2.0,
|
|
7
|
+
Copyright 2026 OriginShape), at commit eab3966 (release 0.2.1). The adapted files are:
|
|
8
|
+
|
|
9
|
+
src/oscar_solidcraft/auth/__init__.py from oscar/auth/__init__.py
|
|
10
|
+
src/oscar_solidcraft/auth/account.py from oscar/auth/account.py
|
|
11
|
+
src/oscar_solidcraft/auth/config.py from oscar/auth/config.py
|
|
12
|
+
src/oscar_solidcraft/auth/device.py from oscar/auth/device.py
|
|
13
|
+
src/oscar_solidcraft/auth/discovery.py from oscar/auth/discovery.py
|
|
14
|
+
src/oscar_solidcraft/auth/keystore.py from oscar/auth/keystore.py
|
|
15
|
+
src/oscar_solidcraft/auth/loopback.py from oscar/auth/loopback.py
|
|
16
|
+
src/oscar_solidcraft/auth/pkce.py from oscar/auth/pkce.py
|
|
17
|
+
src/oscar_solidcraft/auth/session.py from oscar/auth/session.py
|
|
18
|
+
src/oscar_solidcraft/auth/transport.py from oscar/auth/transport.py
|
|
19
|
+
src/oscar_solidcraft/context_guard.py from oscar/context_guard.py
|
|
20
|
+
src/oscar_solidcraft/fsretry.py from oscar/fsretry.py
|
|
21
|
+
src/oscar_solidcraft/logs.py from oscar/turnlog.py
|
|
22
|
+
tests/support/fake_originshape.py from tests/support/fake_originshape.py
|
|
23
|
+
tests/support/isolation.py from tests/support/isolation.py
|
|
24
|
+
tests/test_auth_basics.py, test_auth_device.py, test_auth_fake.py, test_auth_keystore.py,
|
|
25
|
+
test_auth_loopback.py, test_auth_redaction.py, test_auth_session.py from the tests of the same names
|
|
26
|
+
|
|
27
|
+
They were modified for this program: its own OAuth client and keychain item, its own folders, SolidCraft wording, the
|
|
28
|
+
FreeCAD settings and workspace code removed. Nothing in this product comes from FreeCAD itself or from the
|
|
29
|
+
MIT-licensed parts of Oscar for FreeCAD (oscar/cad/).
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: oscar-solidcraft
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Oscar for SolidCraft: OriginShape's CAD assistant as an Agent Client Protocol agent for SolidCraft
|
|
5
|
+
Project-URL: Homepage, https://originshape.design
|
|
6
|
+
Project-URL: Source, https://github.com/Originshape/oscar-solidcraft
|
|
7
|
+
Author-email: OriginShape <hello@originshape.design>
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
License-File: NOTICE
|
|
11
|
+
Keywords: acp,agent-client-protocol,cad,mcp,originshape,solidcraft
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Manufacturing
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Requires-Dist: requests<3,>=2.32.4
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Oscar for SolidCraft
|
|
26
|
+
|
|
27
|
+
Oscar from OriginShape, in [SolidCraft](https://solidcraft.io)'s Assistant panel.
|
|
28
|
+
|
|
29
|
+
`oscar-solidcraft` is a small program that SolidCraft runs as an [Agent Client Protocol](https://agentclientprotocol.com) (ACP) agent. It signs you in to your OriginShape account in the browser, sends your messages to OriginShape's model service (which bills your OriginShape credits), and builds the design with SolidCraft's own tools (`batch`, `execute`, `measure`, `screenshot` …). Oscar's CAD know-how lives on OriginShape's server, so Oscar gets better with a server update; this program only connects the pieces.
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
- SolidCraft **0.53.0 or newer**.
|
|
34
|
+
- An OriginShape account. Sign-in happens on [originshape.design](https://app.originshape.design); new accounts get trial credits.
|
|
35
|
+
- [uv](https://docs.astral.sh/uv/) to install it (uv brings its own Python; otherwise Python 3.10 or newer).
|
|
36
|
+
- Git, if you are installing from the cloned repository.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
Before installing Oscar, make sure `uv` is available. The PyPI installation is listed first for users who want the simplest installation. **The package is not yet published on PyPI**, so use the cloned-repository method until publication.
|
|
41
|
+
|
|
42
|
+
### Step 1 — Check and install uv
|
|
43
|
+
|
|
44
|
+
First, check whether uv is already installed:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
uv --version
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If the command is not found, install uv using the instructions for your operating system.
|
|
51
|
+
|
|
52
|
+
**Windows (PowerShell):**
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**macOS or Linux:**
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
After installation, open a new terminal and verify that uv is available:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
uv --version
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 1. Install from PyPI (available after publication)
|
|
71
|
+
|
|
72
|
+
Once the package is published to PyPI, install Oscar with:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
uv tool install oscar-solidcraft
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Verify the installation:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
oscar-solidcraft --help
|
|
82
|
+
oscar-solidcraft --version
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Update a PyPI installation later with:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
uv tool upgrade oscar-solidcraft
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The project page will be `https://pypi.org/project/oscar-solidcraft/`.
|
|
92
|
+
|
|
93
|
+
### 2. Install from a cloned repository (works today)
|
|
94
|
+
|
|
95
|
+
Until the package is published on PyPI, install Oscar from its GitHub repository.
|
|
96
|
+
|
|
97
|
+
Clone the `develop` branch, which contains the current installation and compatibility updates:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
git clone -b develop https://github.com/Originshape/Oscar-solidcraft.git
|
|
101
|
+
cd Oscar-solidcraft
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Install Oscar:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
uv tool install .
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
uv builds the package and installs it as an isolated tool with its own Python environment — no virtual environment to create or activate.
|
|
111
|
+
|
|
112
|
+
Verify the installation:
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
oscar-solidcraft --help
|
|
116
|
+
oscar-solidcraft --version
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
To update this installation later, run these commands from the cloned repository:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
git pull
|
|
123
|
+
uv tool install . --reinstall
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Restart or reconnect Oscar in SolidCraft after updating.
|
|
127
|
+
|
|
128
|
+
### Run from a cloned repository
|
|
129
|
+
|
|
130
|
+
Developers can also run Oscar directly from a local clone of the repository without installing it as an isolated tool. This editable installation is intended for development and testing.
|
|
131
|
+
|
|
132
|
+
#### 1. Clone and install
|
|
133
|
+
|
|
134
|
+
Open PowerShell and run:
|
|
135
|
+
|
|
136
|
+
```powershell
|
|
137
|
+
git clone -b develop https://github.com/Originshape/Oscar-solidcraft.git
|
|
138
|
+
cd Oscar-solidcraft
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Create a Python virtual environment:
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
uv venv --python 3.10 .venv
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Install Oscar and its development dependencies:
|
|
148
|
+
|
|
149
|
+
```powershell
|
|
150
|
+
uv pip install --python .venv\Scripts\python.exe -e ".[dev]"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The `-e` option installs the project in editable mode. Changes to the local source code are available without reinstalling the package.
|
|
154
|
+
|
|
155
|
+
#### 2. Configure Oscar in SolidCraft
|
|
156
|
+
|
|
157
|
+
1. Open **SolidCraft → Preferences → Assistant**.
|
|
158
|
+
2. Select **Add agent**.
|
|
159
|
+
3. Choose **Custom command**.
|
|
160
|
+
4. Enter the following details:
|
|
161
|
+
|
|
162
|
+
| Field | Value |
|
|
163
|
+
| ------------- | ----- |
|
|
164
|
+
| Kind | Custom command |
|
|
165
|
+
| Name | Oscar |
|
|
166
|
+
| Agent command | `oscar-solidcraft` for a tool installation; full path to `oscar-solidcraft.exe` for an editable installation |
|
|
167
|
+
|
|
168
|
+
#### 3. Find the Agent command
|
|
169
|
+
|
|
170
|
+
For an editable installation, SolidCraft requires the full absolute path to Oscar's executable. For a tool installation, enter `oscar-solidcraft`.
|
|
171
|
+
|
|
172
|
+
**Method 1: Using PowerShell (recommended)**
|
|
173
|
+
|
|
174
|
+
Open PowerShell in your cloned repository directory and run:
|
|
175
|
+
|
|
176
|
+
```powershell
|
|
177
|
+
Resolve-Path .\.venv\Scripts\oscar-solidcraft.exe
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
PowerShell displays the full executable path, for example:
|
|
181
|
+
|
|
182
|
+
```text
|
|
183
|
+
C:\Users\YourName\Oscar-solidcraft\.venv\Scripts\oscar-solidcraft.exe
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Copy the resulting path and paste it into SolidCraft's **Agent command** field.
|
|
187
|
+
|
|
188
|
+
**Method 2: Using File Explorer**
|
|
189
|
+
|
|
190
|
+
1. Open your cloned `Oscar-solidcraft` repository.
|
|
191
|
+
2. Open the `.venv` folder.
|
|
192
|
+
3. Open the `Scripts` folder.
|
|
193
|
+
4. Find `oscar-solidcraft.exe`.
|
|
194
|
+
5. Right-click the executable and select **Copy as path**.
|
|
195
|
+
6. Paste the copied path into SolidCraft's **Agent command** field.
|
|
196
|
+
|
|
197
|
+
**Verify that the executable exists:**
|
|
198
|
+
|
|
199
|
+
```powershell
|
|
200
|
+
Test-Path .\.venv\Scripts\oscar-solidcraft.exe
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The command should return `True`.
|
|
204
|
+
|
|
205
|
+
If it returns `False`, check that the installation completed successfully.
|
|
206
|
+
|
|
207
|
+
#### 4. Add and connect Oscar
|
|
208
|
+
|
|
209
|
+
1. Click **Add** or **Save** in the Add Agent dialog.
|
|
210
|
+
2. Find Oscar under the **Agents** section.
|
|
211
|
+
3. Click **Test** to verify that the agent starts successfully.
|
|
212
|
+
4. Select the required permissions.
|
|
213
|
+
5. Click **OK** to save your settings.
|
|
214
|
+
6. Open the **Assistant** panel.
|
|
215
|
+
7. Select Oscar and press **Connect**.
|
|
216
|
+
8. Press **Sign in with OriginShape**.
|
|
217
|
+
9. Your browser opens on originshape.design. Approve the sign-in request.
|
|
218
|
+
|
|
219
|
+
Once authenticated, Oscar is ready to use.
|
|
220
|
+
|
|
221
|
+
The line under the Connect button shows your signed-in account and available credits, like `you@example.com · 42.5 credits`.
|
|
222
|
+
|
|
223
|
+
**Important:** For an editable installation, use the full absolute path to `oscar-solidcraft.exe`. Do not enter just the repository directory or the Python interpreter path. For a tool installation, enter `oscar-solidcraft`.
|
|
224
|
+
|
|
225
|
+
#### 5. Verify the installation
|
|
226
|
+
|
|
227
|
+
For an editable installation, run the following command from the repository directory:
|
|
228
|
+
|
|
229
|
+
```powershell
|
|
230
|
+
.\.venv\Scripts\oscar-solidcraft.exe --version
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
For a tool installation, run:
|
|
234
|
+
|
|
235
|
+
```powershell
|
|
236
|
+
oscar-solidcraft --version
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
To run the automated tests for the editable installation:
|
|
240
|
+
|
|
241
|
+
```powershell
|
|
242
|
+
.\.venv\Scripts\python.exe -m pytest
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### Updating a local installation
|
|
246
|
+
|
|
247
|
+
After pulling the latest changes from the repository, run:
|
|
248
|
+
|
|
249
|
+
```powershell
|
|
250
|
+
git pull
|
|
251
|
+
uv pip install --python .venv\Scripts\python.exe -e ".[dev]"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Restart or reconnect Oscar in SolidCraft after updating.
|
|
255
|
+
|
|
256
|
+
## Add it to SolidCraft
|
|
257
|
+
|
|
258
|
+
For users who installed Oscar using `uv tool install .`:
|
|
259
|
+
|
|
260
|
+
1. Open **Preferences → AI → Add agent → Custom command**, and enter `oscar-solidcraft`.
|
|
261
|
+
2. Press **Test**. Before you have signed in it reports "Sign-in needed"; that is expected.
|
|
262
|
+
3. Open the **Assistant** panel, pick Oscar and press **Connect**.
|
|
263
|
+
4. Press **Sign in with OriginShape**. Your browser opens on originshape.design; approve there, and the panel is ready. The line under the Connect button then shows `you@example.com · 42.5 credits`.
|
|
264
|
+
|
|
265
|
+
For an editable installation, use the full path to `.venv\Scripts\oscar-solidcraft.exe` as the Custom command instead.
|
|
266
|
+
|
|
267
|
+
No browser on this computer? Choose **OriginShape with a code** instead: SolidCraft shows a command to copy. Run it (`oscar-solidcraft login --device`) in a terminal, enter the code it prints on any device, then press **I've signed in: connect again**.
|
|
268
|
+
|
|
269
|
+
Pick **Origin1** or **Origin1 Super** in the panel's model menu. Each design tab runs its own Oscar; they share one sign-in.
|
|
270
|
+
|
|
271
|
+
While Oscar is connected, the **Integrations** page on originshape.design shows SolidCraft as **Running** on this computer, and the credits under the Connect button stay current.
|
|
272
|
+
|
|
273
|
+
## Commands
|
|
274
|
+
|
|
275
|
+
| Command | What it does |
|
|
276
|
+
| ------- | ------------ |
|
|
277
|
+
| `oscar-solidcraft` | Runs the agent on stdin/stdout. SolidCraft starts it; you don't run it yourself. |
|
|
278
|
+
| `oscar-solidcraft login` | Signs in with your browser. |
|
|
279
|
+
| `oscar-solidcraft login --device` | Signs in with a code, for a computer without a browser. |
|
|
280
|
+
| `oscar-solidcraft login --api-url URL` | Signs in to another OriginShape server and keeps using it (saved). It warns you first: that server receives your messages and design pictures. |
|
|
281
|
+
| `oscar-solidcraft logout` | Signs out on this computer and revokes the sign-in. |
|
|
282
|
+
| `oscar-solidcraft status` | Who is signed in, credits, the server, where the sign-in is kept, and the log folder. Exits with code 1 when you are not signed in (0 otherwise), so scripts can check the state. |
|
|
283
|
+
| `oscar-solidcraft --version` | Prints the version. |
|
|
284
|
+
|
|
285
|
+
You can also sign Oscar out from the website: **Settings → Devices**, then revoke the app.
|
|
286
|
+
|
|
287
|
+
## Environment variables
|
|
288
|
+
|
|
289
|
+
| Variable | Default | Meaning |
|
|
290
|
+
| -------- | ------- | ------- |
|
|
291
|
+
| `OSCAR_API_URL` | `https://app.originshape.design` | The OriginShape server (wins over `login --api-url`). Any other server is named in the line under SolidCraft's Connect button. |
|
|
292
|
+
| `ORIGINSHAPE_HOME` | `~/.originshape` | Oscar keeps its files in `$ORIGINSHAPE_HOME/oscar-solidcraft/`. |
|
|
293
|
+
| `OSCAR_CREDENTIAL_STORE` | `auto` | Where the sign-in is kept: `auto` (the system keychain, else a file), `keychain`, `file` or `memory`. |
|
|
294
|
+
| `OSCAR_CREDENTIAL_FILE` | `$ORIGINSHAPE_HOME/oscar-solidcraft/credentials.json` | The file used by `file` (and by `auto` without a keychain). |
|
|
295
|
+
| `OSCAR_LOG_LEVEL` | `info` | `debug`, `info`, `warning` or `error`. |
|
|
296
|
+
| `BROWSER` | the system's | The command that opens the sign-in page (`%s` is replaced by the address). |
|
|
297
|
+
| `OSCAR_DOCTRINE` | `on` | `off` removes Oscar's built-in instructions block from the system prompt (baseline runs); any other value is ignored. |
|
|
298
|
+
| `OSCAR_DOCTRINE_FILE` | the built-in text | A path to a file that replaces the built-in instructions block. Read once per run; a missing or unreadable file leaves Oscar without the block (a warning is logged). |
|
|
299
|
+
| `OSCAR_MCP_ALL_TOOLS` | `on` | `off`, `0`, `false` or `no` stops Oscar from turning SolidCraft's all-tools switch on for the tool server it starts, leaving that server's default (the eight core tools). A `SOLIDCRAFT_MCP_ALL_TOOLS` value set by SolidCraft or by you always wins over Oscar's default. |
|
|
300
|
+
|
|
301
|
+
## Files
|
|
302
|
+
|
|
303
|
+
Everything lives in `$ORIGINSHAPE_HOME/oscar-solidcraft/`, a folder only you can read:
|
|
304
|
+
|
|
305
|
+
- `signed-in.json`: the server and the time you signed in (never a secret, no email), so SolidCraft can show "login found".
|
|
306
|
+
- `credentials.json`: the sign-in, only when no system keychain could be used (readable by you only).
|
|
307
|
+
- `settings.json`: the server chosen with `login --api-url`.
|
|
308
|
+
- `logs/oscar.log`: what Oscar did (events, sizes and outcomes; never your messages or keys, and tokens, email addresses and your home folder are scrubbed from every line). It rotates at 5 MB. `logs/mcp-*.log` holds what SolidCraft's tool server printed.
|
|
309
|
+
|
|
310
|
+
On macOS the sign-in is in your login keychain as **Oscar for SolidCraft**; on Windows in Credential Manager; on Linux in the Secret Service keyring when one runs.
|
|
311
|
+
|
|
312
|
+
## Troubleshooting
|
|
313
|
+
|
|
314
|
+
- **"Sign-in needed" in Test.** Normal before the first sign-in. Connect in the Assistant panel and sign in.
|
|
315
|
+
- **The browser didn't open.** Use **OriginShape with a code**, or run `oscar-solidcraft login` in a terminal (it prints the link), then press **I've signed in: connect again**.
|
|
316
|
+
- **"You're out of OriginShape credits."** Add credits on the billing page the message links to.
|
|
317
|
+
- **"Your OriginShape account is waiting for approval."** You'll get an email once it's approved.
|
|
318
|
+
- **"This version of Oscar for SolidCraft is too old."** From a cloned-repository installation: run `git pull` and reinstall (see [Install](#install)), then Connect again. From a PyPI installation (after publication): run `uv tool upgrade oscar-solidcraft`, then Connect again.
|
|
319
|
+
- **"Oscar stopped here: …"** Oscar ends a message that asks SolidCraft the same thing a third time without the design changing, or that has used 200,000 output tokens, so a runaway message cannot spend your credits. Send another message to go on.
|
|
320
|
+
- **"This message is too large to send."** A message may carry 100 parts, pictures up to 10 MB and PDFs up to 16 MB, 24 MB in all. Attach fewer or smaller files.
|
|
321
|
+
- **"SolidCraft's tools could not be started."** Press Connect again. If it persists, check SolidCraft's AI settings (its tool bridge must be on) and `logs/mcp-*.log`.
|
|
322
|
+
- **"SolidCraft can't find the command."** For a tool installation, run `uv tool update-shell`, or enter the full path that `where oscar-solidcraft` (Windows) or `which oscar-solidcraft` (macOS/Linux) prints. For an editable clone, enter the full path to `.venv\Scripts\oscar-solidcraft.exe`.
|
|
323
|
+
- **Anything else.** `oscar-solidcraft status` shows the state and `logs/oscar.log` what happened. SolidCraft shows the last lines Oscar wrote to stderr when it stops.
|
|
324
|
+
|
|
325
|
+
## What data goes where
|
|
326
|
+
|
|
327
|
+
- **Your messages, the pictures and PDFs you attach, the view picture SolidCraft attaches, and the results of SolidCraft's tools** (including screenshots of your design) are sent to OriginShape's model service, which adds Oscar's instructions and forwards them to the model provider (Anthropic) to produce the answer. Credentials found in that text are replaced with `[redacted credential]` before anything is sent.
|
|
328
|
+
- **Your OriginShape sign-in** goes only to OriginShape's server. SolidCraft never sees it, and it is never written to the log or to stderr.
|
|
329
|
+
- **Your design** stays in SolidCraft. Oscar sees only what SolidCraft's tools return during a message you sent.
|
|
330
|
+
- **Oscar's reasoning:** the panel shows short summaries of it (dimmed), not the model's full reasoning.
|
|
331
|
+
- OriginShape records usage (model, token counts, credits) per request, as on the website. See OriginShape's privacy policy for how long data is kept.
|
|
332
|
+
|
|
333
|
+
`SECURITY.md` says what Oscar stores and sends in more detail, and how to report a security problem.
|
|
334
|
+
|
|
335
|
+
## Development
|
|
336
|
+
|
|
337
|
+
```sh
|
|
338
|
+
uv venv --python 3.10 .venv
|
|
339
|
+
uv pip install --python .venv/bin/python -e '.[dev]'
|
|
340
|
+
.venv/bin/python -m pytest
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
The tests never touch your keychain, your `~/.originshape` or a real OriginShape server: they run against a fake OriginShape (OAuth, account, model list, and a gateway that behaves like the real one, Oscar's prompt included) and a fake SolidCraft tool server, and they drive `python -m oscar_solidcraft` over stdio the way SolidCraft does.
|
|
344
|
+
|
|
345
|
+
One test uses the real SolidCraft engine. It builds and measures a box with `solidcraft-cli mcp --headless`:
|
|
346
|
+
|
|
347
|
+
```sh
|
|
348
|
+
SOLIDCRAFT_CLI=/path/to/solidcraft-cli .venv/bin/python -m pytest tests/test_solidcraft_real.py
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
`docs/architecture.md` explains how the program is put together, what it expects from SolidCraft and from the OriginShape server, and the limits it puts on everything it receives.
|
|
352
|
+
|
|
353
|
+
## License
|
|
354
|
+
|
|
355
|
+
Apache-2.0. See `LICENSE` and `NOTICE`.
|