mindsim 0.1.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/.github/workflows/publish.yml +32 -0
- package/.github/workflows/test.yml +28 -0
- package/.github/workflows/type-checks.yml +29 -0
- package/LICENSE +21 -0
- package/README.md +748 -0
- package/assets/mindsim-logo.svg +15 -0
- package/biome.jsonc +43 -0
- package/dist/auth.d.ts +5 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +115 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +36 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +63 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/artifacts.d.ts +8 -0
- package/dist/resources/artifacts.d.ts.map +1 -0
- package/dist/resources/artifacts.js +17 -0
- package/dist/resources/artifacts.js.map +1 -0
- package/dist/resources/minds.d.ts +39 -0
- package/dist/resources/minds.d.ts.map +1 -0
- package/dist/resources/minds.js +85 -0
- package/dist/resources/minds.js.map +1 -0
- package/dist/resources/psychometrics.d.ts +11 -0
- package/dist/resources/psychometrics.d.ts.map +1 -0
- package/dist/resources/psychometrics.js +18 -0
- package/dist/resources/psychometrics.js.map +1 -0
- package/dist/resources/simulations.d.ts +26 -0
- package/dist/resources/simulations.d.ts.map +1 -0
- package/dist/resources/simulations.js +41 -0
- package/dist/resources/simulations.js.map +1 -0
- package/dist/resources/snapshots.d.ts +27 -0
- package/dist/resources/snapshots.d.ts.map +1 -0
- package/dist/resources/snapshots.js +101 -0
- package/dist/resources/snapshots.js.map +1 -0
- package/dist/resources/tags.d.ts +23 -0
- package/dist/resources/tags.d.ts.map +1 -0
- package/dist/resources/tags.js +32 -0
- package/dist/resources/tags.js.map +1 -0
- package/dist/types.d.ts +161 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +105 -0
- package/dist/version.js.map +1 -0
- package/package.json +55 -0
- package/src/auth.ts +131 -0
- package/src/cli.ts +41 -0
- package/src/config.ts +60 -0
- package/src/index.ts +59 -0
- package/src/resources/artifacts.ts +13 -0
- package/src/resources/minds.ts +98 -0
- package/src/resources/psychometrics.ts +16 -0
- package/src/resources/simulations.ts +49 -0
- package/src/resources/snapshots.ts +126 -0
- package/src/resources/tags.ts +30 -0
- package/src/types.ts +185 -0
- package/src/version.ts +111 -0
- package/tests/auth.test.ts +41 -0
- package/tests/config.test.ts +129 -0
- package/tests/resources/minds.test.ts +119 -0
- package/tests/resources/psychometrics.test.ts +38 -0
- package/tests/resources/simulation.test.ts +94 -0
- package/tests/resources/snapshots.test.ts +135 -0
- package/tests/resources/tags.test.ts +87 -0
- package/tests/use-cases/quickstart.test.ts +84 -0
- package/tests/version.test.ts +221 -0
- package/tsconfig.json +29 -0
- package/vitest.config.ts +12 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg width="112" height="30" viewBox="0 0 112 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M22.9999 20.7235C23.4715 19.9616 23.8162 19.1273 24.052 18.2566C24.1971 17.7125 24.2696 17.1502 24.2696 16.5697C24.2696 16.3339 24.2696 16.0981 24.2696 15.8623C24.2696 14.7015 24.2334 14.3387 24.052 13.6132C23.7073 12.416 23.1632 11.3096 22.4558 10.2938C21.1498 8.62505 19.3359 7.44604 17.2863 6.92002C16.3249 6.66608 14.4204 6.59353 13.4228 6.79305C9.70437 7.46418 6.76592 10.3301 5.96782 14.0122C5.87713 14.4657 5.80458 14.9373 5.7683 15.4089C5.73202 16.0437 5.75016 16.2251 5.89527 16.4972C6.38501 17.4404 7.7454 17.4948 8.19887 16.5879C8.32584 16.207 8.41653 15.8079 8.43467 15.3907C8.5435 13.8127 9.23276 12.3435 10.3574 11.237C10.4662 11.1644 10.575 11.0738 10.6838 10.9831C12.4433 9.47756 14.8557 9.00596 17.0505 9.74964C18.0662 10.0761 18.9732 10.6384 19.7169 11.4184C20.4968 12.1983 20.8959 12.8513 21.2949 14.0122C22.4558 17.4041 20.6419 21.0862 17.25 22.229C16.9779 22.3197 16.7059 22.3922 16.4156 22.4466V19.6896C18.0118 19.1998 19.1001 17.7125 19.1001 16.0437C19.1001 14.3568 17.377 12.2165 15.2548 12.2165C13.1326 12.2165 11.4275 13.9396 11.4094 16.0437C11.4094 17.7125 12.4977 19.1998 14.0939 19.6896V22.628C12.8786 22.4648 11.7177 21.9569 10.7383 21.1769C9.92203 20.5239 9.50484 20.3426 8.97882 20.4514C8.3077 20.5965 7.89051 21.2676 8.03562 21.9388C8.03562 21.9388 8.03562 21.975 8.03562 21.9932C8.12631 22.4466 8.59791 22.9545 9.5774 23.6438C10.9015 24.587 12.4614 25.1674 14.0758 25.3125V27.7068C14.0758 28.3417 14.6018 28.8677 15.2366 28.8495C15.8715 28.8495 16.3794 28.3417 16.3794 27.7068V25.24C17.5402 25.0586 18.6467 24.6777 19.6806 24.0791C20.0978 23.8433 20.4968 23.5531 20.8414 23.2085C21.1498 22.9545 21.44 22.6824 21.7121 22.3922C21.9298 22.1746 22.1293 21.9387 22.3107 21.7029C22.5465 21.4127 22.7641 21.1044 22.9637 20.7779C22.9637 20.7779 22.9637 20.7779 22.9637 20.7597L22.9999 20.7235ZM15.2548 17.5855C14.4023 17.5855 13.713 16.8962 13.713 16.0619C13.713 15.2093 14.4023 14.5201 15.2366 14.5201C16.0891 14.5201 16.7784 15.2093 16.7784 16.0437C16.7784 16.8962 16.0891 17.5855 15.2548 17.5855Z" fill="url(#paint0_linear_8663_2)"/>
|
|
3
|
+
<path d="M27.643 9.7497C26.8812 8.22606 26.4096 7.62749 24.9404 6.12199C23.7251 4.9067 23.453 4.6709 22.7094 4.21744C21.0769 3.20168 19.263 2.49428 17.3585 2.14964C15.8348 1.95012 14.2931 1.95012 12.7694 2.14964C7.09205 3.11099 2.503 7.46424 1.32399 13.0509C0.507756 16.7512 1.25144 20.6328 3.35551 23.7708C4.02664 24.8047 5.20564 26.0925 5.62283 26.2377C5.9856 26.3828 6.33023 26.3283 6.76556 26.0925C7.0195 25.9474 7.09205 25.8386 7.23716 25.494C7.47296 24.8773 7.36413 24.5508 6.62045 23.6983C4.7159 21.5216 3.73642 19.0548 3.682 16.2977C3.59131 10.6748 7.36413 5.9406 12.8601 4.85229C15.8167 4.27185 18.864 4.85229 21.3852 6.5029C22.2378 7.04706 23.9428 8.69766 24.4688 9.5139C26.0831 11.9082 26.7543 14.8285 26.3371 17.7125C26.1738 18.8371 25.5934 20.5784 25.0855 21.4491C24.5776 22.3197 23.9791 23.136 23.3079 23.8796C22.8182 24.3694 22.6005 25.1856 23.0177 25.7842C23.3442 26.1832 23.8521 26.3646 24.36 26.2739C24.6865 26.2014 24.7772 26.1288 25.539 25.2944C29.3299 21.1589 30.1824 14.8466 27.6612 9.78598L27.643 9.7497Z" fill="url(#paint1_linear_8663_2)"/>
|
|
4
|
+
<path d="M39.42 22V12.6H40.82V22H39.42ZM45.88 22V16.24C45.88 15.4667 45.6467 14.8533 45.18 14.4C44.7133 13.9333 44.1267 13.7 43.42 13.7C42.94 13.7 42.5 13.8067 42.1 14.02C41.7133 14.22 41.4 14.5067 41.16 14.88C40.9333 15.2533 40.82 15.7 40.82 16.22L40.18 15.96C40.18 15.24 40.34 14.6133 40.66 14.08C40.98 13.5467 41.4067 13.1333 41.94 12.84C42.4867 12.5467 43.1 12.4 43.78 12.4C44.4467 12.4 45.04 12.5467 45.56 12.84C46.0933 13.1333 46.5133 13.5467 46.82 14.08C47.14 14.6133 47.3 15.2467 47.3 15.98V22H45.88ZM52.36 22V16.24C52.36 15.4667 52.1267 14.8533 51.66 14.4C51.1933 13.9333 50.6 13.7 49.88 13.7C49.4133 13.7 48.98 13.8067 48.58 14.02C48.1933 14.22 47.88 14.5067 47.64 14.88C47.4133 15.2533 47.3 15.7 47.3 16.22L46.46 15.96C46.5 15.24 46.6867 14.6133 47.02 14.08C47.3667 13.5467 47.8133 13.1333 48.36 12.84C48.92 12.5467 49.5333 12.4 50.2 12.4C50.8667 12.4 51.4667 12.5467 52 12.84C52.5467 13.1333 52.9733 13.5467 53.28 14.08C53.6 14.6133 53.76 15.2467 53.76 15.98V22H52.36ZM56.1927 22V12.6H57.6127V22H56.1927ZM56.8927 10.56C56.626 10.56 56.3993 10.4667 56.2127 10.28C56.026 10.08 55.9327 9.84667 55.9327 9.58C55.9327 9.3 56.026 9.06667 56.2127 8.88C56.3993 8.69333 56.626 8.6 56.8927 8.6C57.186 8.6 57.4193 8.69333 57.5927 8.88C57.7793 9.06667 57.8727 9.3 57.8727 9.58C57.8727 9.84667 57.7793 10.08 57.5927 10.28C57.4193 10.4667 57.186 10.56 56.8927 10.56ZM67.0905 22V16.48C67.0905 15.6533 66.8438 14.9867 66.3505 14.48C65.8705 13.96 65.2305 13.7 64.4305 13.7C63.8838 13.7 63.4038 13.82 62.9905 14.06C62.5771 14.3 62.2505 14.6267 62.0105 15.04C61.7705 15.4533 61.6505 15.9267 61.6505 16.46L61.0105 16.1C61.0105 15.3933 61.1771 14.76 61.5105 14.2C61.8438 13.64 62.2905 13.2 62.8505 12.88C63.4238 12.56 64.0771 12.4 64.8105 12.4C65.5305 12.4 66.1705 12.5733 66.7305 12.92C67.2905 13.2667 67.7238 13.7333 68.0305 14.32C68.3505 14.9067 68.5105 15.5467 68.5105 16.24V22H67.0905ZM60.2505 22V12.6H61.6505V22H60.2505ZM74.9294 22.2C74.0627 22.2 73.2827 21.9867 72.5894 21.56C71.896 21.1333 71.3427 20.5533 70.9294 19.82C70.5294 19.0733 70.3294 18.24 70.3294 17.32C70.3294 16.3867 70.5294 15.5533 70.9294 14.82C71.3427 14.0733 71.896 13.4867 72.5894 13.06C73.2827 12.62 74.0627 12.4 74.9294 12.4C75.636 12.4 76.276 12.54 76.8494 12.82C77.4227 13.1 77.896 13.5 78.2694 14.02C78.656 14.5267 78.8827 15.1267 78.9494 15.82V18.76C78.8694 19.44 78.6427 20.04 78.2694 20.56C77.9094 21.0667 77.4427 21.4667 76.8694 21.76C76.296 22.0533 75.6494 22.2 74.9294 22.2ZM75.1694 20.86C75.8227 20.86 76.396 20.7133 76.8894 20.42C77.3827 20.1133 77.7694 19.6933 78.0494 19.16C78.3294 18.6133 78.4694 17.9933 78.4694 17.3C78.4694 16.5933 78.3227 15.9733 78.0294 15.44C77.7494 14.9067 77.3627 14.4867 76.8694 14.18C76.376 13.8733 75.8027 13.72 75.1494 13.72C74.496 13.72 73.916 13.8733 73.4094 14.18C72.9027 14.4867 72.5027 14.9133 72.2094 15.46C71.9294 15.9933 71.7894 16.6067 71.7894 17.3C71.7894 17.9933 71.9294 18.6133 72.2094 19.16C72.5027 19.6933 72.9027 20.1133 73.4094 20.42C73.9294 20.7133 74.516 20.86 75.1694 20.86ZM79.7894 22H78.3894V19.48L78.6694 17.16L78.3894 14.9V7.84H79.7894V22ZM85.3686 22.2C84.8353 22.2 84.3219 22.1333 83.8286 22C83.3353 21.8533 82.8819 21.6533 82.4686 21.4C82.0553 21.1333 81.6953 20.8133 81.3886 20.44L82.7886 19.04C83.1219 19.4267 83.5019 19.72 83.9286 19.92C84.3686 20.1067 84.8619 20.2 85.4086 20.2C85.9019 20.2 86.2753 20.1267 86.5286 19.98C86.7819 19.8333 86.9086 19.62 86.9086 19.34C86.9086 19.0467 86.7886 18.82 86.5486 18.66C86.3086 18.5 85.9953 18.3667 85.6086 18.26C85.2353 18.14 84.8353 18.02 84.4086 17.9C83.9953 17.78 83.5953 17.62 83.2086 17.42C82.8353 17.2067 82.5286 16.92 82.2886 16.56C82.0486 16.2 81.9286 15.7333 81.9286 15.16C81.9286 14.5467 82.0686 14.02 82.3486 13.58C82.6419 13.14 83.0486 12.8 83.5686 12.56C84.1019 12.32 84.7353 12.2 85.4686 12.2C86.2419 12.2 86.9219 12.34 87.5086 12.62C88.1086 12.8867 88.6086 13.2933 89.0086 13.84L87.6086 15.24C87.3286 14.8933 87.0086 14.6333 86.6486 14.46C86.2886 14.2867 85.8753 14.2 85.4086 14.2C84.9686 14.2 84.6286 14.2667 84.3886 14.4C84.1486 14.5333 84.0286 14.7267 84.0286 14.98C84.0286 15.2467 84.1486 15.4533 84.3886 15.6C84.6286 15.7467 84.9353 15.8733 85.3086 15.98C85.6953 16.0867 86.0953 16.2067 86.5086 16.34C86.9353 16.46 87.3353 16.6333 87.7086 16.86C88.0953 17.0733 88.4086 17.3667 88.6486 17.74C88.8886 18.1 89.0086 18.5733 89.0086 19.16C89.0086 20.0933 88.6819 20.8333 88.0286 21.38C87.3753 21.9267 86.4886 22.2 85.3686 22.2ZM90.6423 22V12.4H92.8423V22H90.6423ZM91.7423 10.64C91.369 10.64 91.0557 10.5133 90.8023 10.26C90.5623 10.0067 90.4423 9.69333 90.4423 9.32C90.4423 8.94667 90.5623 8.63333 90.8023 8.38C91.0557 8.12667 91.369 8 91.7423 8C92.129 8 92.4423 8.12667 92.6823 8.38C92.9223 8.63333 93.0423 8.94667 93.0423 9.32C93.0423 9.69333 92.9223 10.0067 92.6823 10.26C92.4423 10.5133 92.129 10.64 91.7423 10.64ZM95.1098 22V12.4H97.3098V22H95.1098ZM101.49 22V16.28C101.49 15.64 101.29 15.1467 100.89 14.8C100.49 14.44 99.9965 14.26 99.4098 14.26C99.0098 14.26 98.6498 14.34 98.3298 14.5C98.0232 14.66 97.7765 14.8933 97.5898 15.2C97.4032 15.4933 97.3098 15.8533 97.3098 16.28L96.4498 15.8C96.4498 15.0667 96.6098 14.4333 96.9298 13.9C97.2498 13.3667 97.6832 12.9533 98.2298 12.66C98.7765 12.3533 99.3898 12.2 100.07 12.2C100.75 12.2 101.363 12.3467 101.91 12.64C102.457 12.9333 102.89 13.3467 103.21 13.88C103.53 14.4133 103.69 15.0533 103.69 15.8V22H101.49ZM107.87 22V16.28C107.87 15.64 107.67 15.1467 107.27 14.8C106.87 14.44 106.377 14.26 105.79 14.26C105.403 14.26 105.05 14.34 104.73 14.5C104.41 14.66 104.157 14.8933 103.97 15.2C103.783 15.4933 103.69 15.8533 103.69 16.28L102.45 15.8C102.517 15.0667 102.73 14.4333 103.09 13.9C103.45 13.3667 103.91 12.9533 104.47 12.66C105.043 12.3533 105.67 12.2 106.35 12.2C107.043 12.2 107.67 12.3467 108.23 12.64C108.79 12.9333 109.237 13.3467 109.57 13.88C109.903 14.4133 110.07 15.0533 110.07 15.8V22H107.87Z" fill="white"/>
|
|
5
|
+
<defs>
|
|
6
|
+
<linearGradient id="paint0_linear_8663_2" x1="15.0489" y1="2" x2="15.0489" y2="26.3177" gradientUnits="userSpaceOnUse">
|
|
7
|
+
<stop stop-color="white"/>
|
|
8
|
+
<stop offset="1" stop-color="#A8A8A8"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<linearGradient id="paint1_linear_8663_2" x1="15.0489" y1="2" x2="15.0489" y2="26.3177" gradientUnits="userSpaceOnUse">
|
|
11
|
+
<stop stop-color="white"/>
|
|
12
|
+
<stop offset="1" stop-color="#A8A8A8"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
package/biome.jsonc
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.6/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"defaultBranch": "main",
|
|
7
|
+
"useIgnoreFile": true
|
|
8
|
+
},
|
|
9
|
+
"formatter": {
|
|
10
|
+
"enabled": true,
|
|
11
|
+
"formatWithErrors": false,
|
|
12
|
+
"indentStyle": "space",
|
|
13
|
+
"indentWidth": 2,
|
|
14
|
+
"lineEnding": "lf",
|
|
15
|
+
"lineWidth": 100,
|
|
16
|
+
"attributePosition": "auto"
|
|
17
|
+
},
|
|
18
|
+
"linter": {
|
|
19
|
+
"enabled": true,
|
|
20
|
+
"rules": {
|
|
21
|
+
"recommended": true,
|
|
22
|
+
"suspicious": {
|
|
23
|
+
"noExplicitAny": "off",
|
|
24
|
+
"noImplicitAnyLet": "off"
|
|
25
|
+
},
|
|
26
|
+
"style": {
|
|
27
|
+
"useTemplate": "off"
|
|
28
|
+
},
|
|
29
|
+
"correctness": {
|
|
30
|
+
"noUnusedVariables": {
|
|
31
|
+
"level": "warn",
|
|
32
|
+
"options": {
|
|
33
|
+
"ignoreRestSiblings": true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"noUnusedPrivateClassMembers": "off"
|
|
37
|
+
},
|
|
38
|
+
"complexity": {
|
|
39
|
+
"noBannedTypes": "off"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB3C"}
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.login = login;
|
|
7
|
+
const node_http_1 = __importDefault(require("node:http"));
|
|
8
|
+
const node_url_1 = __importDefault(require("node:url"));
|
|
9
|
+
const open_1 = __importDefault(require("open"));
|
|
10
|
+
const config_1 = require("./config");
|
|
11
|
+
// CONFIGURATION
|
|
12
|
+
const authConfig = (0, config_1.getAuthConfig)();
|
|
13
|
+
/**
|
|
14
|
+
* Starts the login flow
|
|
15
|
+
*/
|
|
16
|
+
async function login() {
|
|
17
|
+
console.log("Initiating authentication...");
|
|
18
|
+
// 1. Create a Promise that resolves when the local server receives the code
|
|
19
|
+
const apiKey = await listenForCallback();
|
|
20
|
+
console.log("Authorization succeeded.");
|
|
21
|
+
// 2. Exchange authorization code for access token
|
|
22
|
+
try {
|
|
23
|
+
// 3. Save credentials to disk
|
|
24
|
+
(0, config_1.saveApiKey)(apiKey);
|
|
25
|
+
console.log("✅ Successfully logged in! Credentials saved.");
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error("❌ Authentication failed:", error);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Spins up a temporary local server to catch the redirect
|
|
34
|
+
*/
|
|
35
|
+
function listenForCallback() {
|
|
36
|
+
const callbackPath = new URL(authConfig.authRedirectPath).pathname;
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
const server = node_http_1.default.createServer(async (req, res) => {
|
|
39
|
+
if (!req.url)
|
|
40
|
+
return;
|
|
41
|
+
const parsedUrl = node_url_1.default.parse(req.url, true);
|
|
42
|
+
const headers = {
|
|
43
|
+
"Access-Control-Allow-Origin": new URL(authConfig.authServerUrl).origin,
|
|
44
|
+
"Access-Control-Allow-Methods": "OPTIONS, POST, GET",
|
|
45
|
+
"Access-Control-Max-Age": 2592000, // 30 days
|
|
46
|
+
"Access-Control-Allow-Headers": "Content-Type,Authorization",
|
|
47
|
+
"Access-Control-Allow-Credentials": "true",
|
|
48
|
+
};
|
|
49
|
+
// Check if the request is for the callback path
|
|
50
|
+
if (parsedUrl.pathname === callbackPath) {
|
|
51
|
+
if (req.method === "OPTIONS") {
|
|
52
|
+
res.writeHead(204, headers);
|
|
53
|
+
res.end();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (req.method === "POST") {
|
|
57
|
+
let body = "";
|
|
58
|
+
req.on("data", (chunk) => {
|
|
59
|
+
body += chunk.toString(); // Collect data chunks
|
|
60
|
+
});
|
|
61
|
+
req.on("end", () => {
|
|
62
|
+
let authResponseData = null;
|
|
63
|
+
try {
|
|
64
|
+
authResponseData = JSON.parse(body);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
console.error(`Got an invalid response: ${body}. Reason: ${err}`);
|
|
68
|
+
reject(err);
|
|
69
|
+
}
|
|
70
|
+
if (!authResponseData) {
|
|
71
|
+
res.end("No api key found");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const apiKey = authResponseData?.apiKey?.key;
|
|
75
|
+
if (!apiKey) {
|
|
76
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
77
|
+
res.end(`<h1>Authentication Error</h1><p>API Key Not Found</p>`);
|
|
78
|
+
server.close();
|
|
79
|
+
reject(new Error("API Key Not Found"));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (apiKey) {
|
|
83
|
+
// Send a nice "Close this window" message to the user
|
|
84
|
+
res.writeHead(200, { "Content-Type": "text/html", ...headers });
|
|
85
|
+
res.end(`
|
|
86
|
+
<h1>Authentication Successful</h1>
|
|
87
|
+
<p>You can close this window and return to your terminal.</p>
|
|
88
|
+
<script>window.close()</script>
|
|
89
|
+
`);
|
|
90
|
+
server.close();
|
|
91
|
+
resolve(apiKey);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
res.end("No code found");
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
server.listen(authConfig.listenPort, async () => {
|
|
101
|
+
const state = JSON.stringify({
|
|
102
|
+
redirect: `${authConfig.authServerLandingPath}?initCallbackUrl=${encodeURIComponent(authConfig.authRedirectPath)}`,
|
|
103
|
+
});
|
|
104
|
+
const encodedState = btoa(state);
|
|
105
|
+
const loginUrl = `${authConfig.authServerUrl}?state=${encodedState}`;
|
|
106
|
+
console.log(`Listening on port ${authConfig.listenPort}...`);
|
|
107
|
+
console.log(`Opening browser to: ${loginUrl}`);
|
|
108
|
+
await (0, open_1.default)(loginUrl);
|
|
109
|
+
});
|
|
110
|
+
server.on("error", (err) => {
|
|
111
|
+
reject(err);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":";;;;;AAYA,sBAkBC;AA9BD,0DAA6B;AAC7B,wDAA2B;AAC3B,gDAAwB;AACxB,qCAAqD;AAGrD,gBAAgB;AAChB,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;AAEnC;;GAEG;AACI,KAAK,UAAU,KAAK;IACzB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAE5C,4EAA4E;IAC5E,MAAM,MAAM,GAAG,MAAM,iBAAiB,EAAE,CAAC;IAEzC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAExC,kDAAkD;IAClD,IAAI,CAAC;QACH,8BAA8B;QAC9B,IAAA,mBAAU,EAAC,MAAM,CAAC,CAAC;QAEnB,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB;IACxB,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC;IAEnE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,M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C,CAAC;YAEH,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YAEjC,MAAM,QAAQ,GAAG,GAAG,UAAU,CAAC,aAAa,UAAU,YAAY,EAAE,CAAC;YAErE,OAAO,CAAC,GAAG,CAAC,qBAAqB,UAAU,CAAC,UAAU,KAAK,CAAC,CAAC;YAC7D,OAAO,CAAC,GAAG,CAAC,uBAAuB,QAAQ,EAAE,CAAC,CAAC;YAE/C,MAAM,IAAA,cAAI,EAAC,QAAQ,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACzB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const auth_1 = require("./auth");
|
|
6
|
+
const version_1 = require("./version");
|
|
7
|
+
const program = new commander_1.Command();
|
|
8
|
+
const main = async () => {
|
|
9
|
+
program.name("mindsim").description("CLI for Mindsim SDK").version((0, version_1.getPackageVersion)()); // Use the reusable extractor
|
|
10
|
+
program
|
|
11
|
+
.command("version")
|
|
12
|
+
.description("Output your current MindSim CLI version and check for updates")
|
|
13
|
+
.action(async () => {
|
|
14
|
+
// When explicitly asking for version, be verbose about update status
|
|
15
|
+
console.log((0, version_1.getPackageVersion)());
|
|
16
|
+
await (0, version_1.checkForUpdates)(true);
|
|
17
|
+
});
|
|
18
|
+
// The Auth Command
|
|
19
|
+
program
|
|
20
|
+
.command("auth")
|
|
21
|
+
.description("Login to Mindsim via browser")
|
|
22
|
+
.action(async () => {
|
|
23
|
+
await (0, version_1.checkForUpdates)(false);
|
|
24
|
+
await (0, auth_1.login)();
|
|
25
|
+
});
|
|
26
|
+
// NEW: The Update Command
|
|
27
|
+
program
|
|
28
|
+
.command("update")
|
|
29
|
+
.description("Auto-update the MindSim SDK to the latest version")
|
|
30
|
+
.action(async () => {
|
|
31
|
+
await (0, version_1.updateSdk)();
|
|
32
|
+
});
|
|
33
|
+
program.parse(process.argv);
|
|
34
|
+
};
|
|
35
|
+
main();
|
|
36
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,iCAA+B;AAC/B,uCAA0E;AAE1E,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;IACtB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,IAAA,2BAAiB,GAAE,CAAC,CAAC,CAAC,6BAA6B;IAEtH,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,+DAA+D,CAAC;SAC5E,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,qEAAqE;QACrE,OAAO,CAAC,GAAG,CAAC,IAAA,2BAAiB,GAAE,CAAC,CAAC;QACjC,MAAM,IAAA,yBAAe,EAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEL,mBAAmB;IACnB,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8BAA8B,CAAC;SAC3C,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,IAAA,yBAAe,EAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,IAAA,YAAK,GAAE,CAAC;IAChB,CAAC,CAAC,CAAC;IAEL,0BAA0B;IAC1B,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,mDAAmD,CAAC;SAChE,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,IAAA,mBAAS,GAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,IAAI,EAAE,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuthConfig } from "./types";
|
|
2
|
+
export declare function getConfigDir(): string;
|
|
3
|
+
export declare function getConfigFile(): string;
|
|
4
|
+
export declare const loadApiKey: () => string | null;
|
|
5
|
+
export declare const saveApiKey: (apiKey: string) => void;
|
|
6
|
+
export declare const getAuthConfig: () => AuthConfig;
|
|
7
|
+
export declare const getApiBaseUrl: () => string;
|
|
8
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQ1C,wBAAgB,YAAY,WAE3B;AAED,wBAAgB,aAAa,WAE5B;AAED,eAAO,MAAM,UAAU,QAAO,MAAM,GAAG,IAiBtC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,KAAG,IAQ3C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,UAOhC,CAAC;AAEF,eAAO,MAAM,aAAa,cAEzB,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getApiBaseUrl = exports.getAuthConfig = exports.saveApiKey = exports.loadApiKey = void 0;
|
|
7
|
+
exports.getConfigDir = getConfigDir;
|
|
8
|
+
exports.getConfigFile = getConfigFile;
|
|
9
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
10
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
11
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
12
|
+
const API_BASE_URL = "https://app.mindsim.com/api/public/v1";
|
|
13
|
+
const AUTH_SERVER_URL = "https://app.mindsim.com/sdk/authorize";
|
|
14
|
+
const AUTH_SERVER_LANDING_PATH = "/sdk-success";
|
|
15
|
+
const AUTH_REDIRECT_URI = "http://localhost:4242/callback";
|
|
16
|
+
const AUTH_PORT = "4242";
|
|
17
|
+
function getConfigDir() {
|
|
18
|
+
return node_path_1.default.join(node_os_1.default.homedir(), ".mindsim");
|
|
19
|
+
}
|
|
20
|
+
function getConfigFile() {
|
|
21
|
+
return node_path_1.default.join(getConfigDir(), "config");
|
|
22
|
+
}
|
|
23
|
+
const loadApiKey = () => {
|
|
24
|
+
try {
|
|
25
|
+
if (process.env.MINDSIM_API_KEY) {
|
|
26
|
+
return process.env.MINDSIM_API_KEY;
|
|
27
|
+
}
|
|
28
|
+
const configFile = getConfigFile();
|
|
29
|
+
if (node_fs_1.default.existsSync(configFile)) {
|
|
30
|
+
const config = JSON.parse(node_fs_1.default.readFileSync(configFile, "utf-8"));
|
|
31
|
+
return config.apiKey || null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
// TODO: define logging interface so users can control where they are written to
|
|
36
|
+
console.error(error);
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
};
|
|
40
|
+
exports.loadApiKey = loadApiKey;
|
|
41
|
+
const saveApiKey = (apiKey) => {
|
|
42
|
+
const configDir = getConfigDir();
|
|
43
|
+
const configFile = getConfigFile();
|
|
44
|
+
if (!node_fs_1.default.existsSync(configDir)) {
|
|
45
|
+
node_fs_1.default.mkdirSync(configDir, { recursive: true });
|
|
46
|
+
}
|
|
47
|
+
node_fs_1.default.writeFileSync(configFile, JSON.stringify({ apiKey }, null, 2));
|
|
48
|
+
};
|
|
49
|
+
exports.saveApiKey = saveApiKey;
|
|
50
|
+
const getAuthConfig = () => {
|
|
51
|
+
return {
|
|
52
|
+
authServerUrl: process.env.MINDSIM_AUTH_SERVER_URL || AUTH_SERVER_URL,
|
|
53
|
+
authServerLandingPath: AUTH_SERVER_LANDING_PATH,
|
|
54
|
+
authRedirectPath: process.env.MINDSIM_AUTH_REDIRECT_URI || AUTH_REDIRECT_URI,
|
|
55
|
+
listenPort: process.env.MINDSIM_AUTH_PORT || AUTH_PORT,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
exports.getAuthConfig = getAuthConfig;
|
|
59
|
+
const getApiBaseUrl = () => {
|
|
60
|
+
return process.env.MIND_SIM_API_BASE_URL || API_BASE_URL;
|
|
61
|
+
};
|
|
62
|
+
exports.getApiBaseUrl = getApiBaseUrl;
|
|
63
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;AAWA,oCAEC;AAED,sCAEC;AAjBD,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAG7B,MAAM,YAAY,GAAG,uCAAuC,CAAC;AAC7D,MAAM,eAAe,GAAG,uCAAuC,CAAC;AAChE,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAChD,MAAM,iBAAiB,GAAG,gCAAgC,CAAC;AAC3D,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB,SAAgB,YAAY;IAC1B,OAAO,mBAAI,CAAC,IAAI,CAAC,iBAAE,CAAC,OAAO,EAAE,EAAE,UAAU,CAAC,CAAC;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Aa,GAAG,GAAe,EAAE;IAC5C,OAAO;QACL,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,eAAe;QACrE,qBAAqB,EAAE,wBAAwB;QAC/C,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,iBAAiB;QAC5E,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,SAAS;KACvD,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB;AAEK,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,OAAO,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,YAAY,CAAC;AAC3D,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ArtifactsResource } from "./resources/artifacts";
|
|
2
|
+
import { MindsResource } from "./resources/minds";
|
|
3
|
+
import { PsychometricsResource } from "./resources/psychometrics";
|
|
4
|
+
import { SimulationsResource } from "./resources/simulations";
|
|
5
|
+
import { SnapshotsResource } from "./resources/snapshots";
|
|
6
|
+
import { TagsResource } from "./resources/tags";
|
|
7
|
+
export declare class MindSim {
|
|
8
|
+
private client;
|
|
9
|
+
artifacts: ArtifactsResource;
|
|
10
|
+
minds: MindsResource;
|
|
11
|
+
psychometrics: PsychometricsResource;
|
|
12
|
+
snapshots: SnapshotsResource;
|
|
13
|
+
simulations: SimulationsResource;
|
|
14
|
+
tags: TagsResource;
|
|
15
|
+
constructor(apiKey?: string, options?: {
|
|
16
|
+
apiBaseUrl?: string;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export * from "./types";
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAgB;IAEvB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,EAAE,qBAAqB,CAAC;IACrC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,WAAW,EAAE,mBAAmB,CAAC;IACjC,IAAI,EAAE,YAAY,CAAC;gBAEd,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;CAmC/D;AAGD,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.MindSim = void 0;
|
|
21
|
+
const axios_1 = __importDefault(require("axios"));
|
|
22
|
+
const config_1 = require("./config");
|
|
23
|
+
const artifacts_1 = require("./resources/artifacts");
|
|
24
|
+
const minds_1 = require("./resources/minds");
|
|
25
|
+
const psychometrics_1 = require("./resources/psychometrics");
|
|
26
|
+
const simulations_1 = require("./resources/simulations");
|
|
27
|
+
const snapshots_1 = require("./resources/snapshots");
|
|
28
|
+
const tags_1 = require("./resources/tags");
|
|
29
|
+
const version_1 = require("./version");
|
|
30
|
+
class MindSim {
|
|
31
|
+
client;
|
|
32
|
+
artifacts;
|
|
33
|
+
minds;
|
|
34
|
+
psychometrics;
|
|
35
|
+
snapshots;
|
|
36
|
+
simulations;
|
|
37
|
+
tags;
|
|
38
|
+
constructor(apiKey, options) {
|
|
39
|
+
// 1. Trigger the auto-update check (Fire and forget, do not await)
|
|
40
|
+
(0, version_1.checkForUpdates)().catch(() => {
|
|
41
|
+
// Catching here ensures no unhandled promise rejections in the user's console
|
|
42
|
+
// if the check fails completely.
|
|
43
|
+
});
|
|
44
|
+
const token = apiKey || (0, config_1.loadApiKey)();
|
|
45
|
+
const sdkVersion = (0, version_1.getPackageVersion)();
|
|
46
|
+
const apiBaseUrl = options?.apiBaseUrl || (0, config_1.getApiBaseUrl)();
|
|
47
|
+
if (!token) {
|
|
48
|
+
throw new Error("API Key not found. Please run `mindsim auth` or pass the key to the constructor.");
|
|
49
|
+
}
|
|
50
|
+
this.client = axios_1.default.create({
|
|
51
|
+
baseURL: apiBaseUrl,
|
|
52
|
+
headers: {
|
|
53
|
+
Authorization: `Bearer ${token}`,
|
|
54
|
+
"Content-Type": "application/json",
|
|
55
|
+
"x-reasoner-source": "sdk",
|
|
56
|
+
"x-reasoner-sdk": "mindsim/mindsim-sdk-typescript",
|
|
57
|
+
"x-reasoner-sdk-version": sdkVersion,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
this.artifacts = new artifacts_1.ArtifactsResource(this.client);
|
|
61
|
+
this.minds = new minds_1.MindsResource(this.client);
|
|
62
|
+
this.psychometrics = new psychometrics_1.PsychometricsResource(this.client);
|
|
63
|
+
this.snapshots = new snapshots_1.SnapshotsResource(this.client);
|
|
64
|
+
this.simulations = new simulations_1.SimulationsResource(this.client);
|
|
65
|
+
this.tags = new tags_1.TagsResource(this.client);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.MindSim = MindSim;
|
|
69
|
+
// Export types for consumer use
|
|
70
|
+
__exportStar(require("./types"), exports);
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kDAAkD;AAClD,qCAAqD;AACrD,qDAA0D;AAC1D,6CAAkD;AAClD,6DAAkE;AAClE,yDAA8D;AAC9D,qDAA0D;AAC1D,2CAAgD;AAChD,uCAA+D;AAE/D,MAAa,OAAO;IACV,MAAM,CAAgB;IAEvB,SAAS,CAAoB;IAC7B,KAAK,CAAgB;IACrB,aAAa,CAAwB;IACrC,SAAS,CAAoB;IAC7B,WAAW,CAAsB;IACjC,IAAI,CAAe;IAE1B,YAAY,MAAe,EAAE,OAAiC;QAC5D,mEAAmE;QACnE,IAAA,yBAAe,GAAE,CAAC,KAAK,CAAC,GAAG,EAAE;YAC3B,8EAA8E;YAC9E,iCAAiC;QACnC,CAAC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,MAAM,IAAI,IAAA,mBAAU,GAAE,CAAC;QACrC,MAAM,UAAU,GAAG,IAAA,2BAAiB,GAAE,CAAC;QACvC,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,IAAA,sBAAa,GAAE,CAAC;QAE1D,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,kFAAkF,CACnF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,cAAc,EAAE,kBAAkB;gBAClC,mBAAmB,EAAE,KAAK;gBAC1B,gBAAgB,EAAE,gCAAgC;gBAClD,wBAAwB,EAAE,UAAU;aACrC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,GAAG,IAAI,6BAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,GAAG,IAAI,qBAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,IAAI,qCAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,SAAS,GAAG,IAAI,6BAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,IAAI,iCAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,IAAI,mBAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF;AA7CD,0BA6CC;AAED,gCAAgC;AAChC,0CAAwB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AxiosInstance } from "axios";
|
|
2
|
+
import type { GetSignedUrlParams, GetSignedUrlResponse } from "../types";
|
|
3
|
+
export declare class ArtifactsResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
6
|
+
getSignedUrl(mindId: string, params?: GetSignedUrlParams): Promise<GetSignedUrlResponse>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/resources/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEzE,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAM/F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArtifactsResource = void 0;
|
|
4
|
+
class ArtifactsResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async getSignedUrl(mindId, params) {
|
|
10
|
+
const response = await this.client.get(`/minds/${mindId}/signed-url`, {
|
|
11
|
+
params,
|
|
12
|
+
});
|
|
13
|
+
return response.data;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ArtifactsResource = ArtifactsResource;
|
|
17
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/resources/artifacts.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAiB;IACR;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,MAA2B;QAC5D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAuB,UAAU,MAAM,aAAa,EAAE;YAC1F,MAAM;SACP,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF;AATD,8CASC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AxiosInstance } from "axios";
|
|
2
|
+
import type { CreateMindRequest, ListMindsParams, Mind, SearchMindsParams, UpdateMindRequest } from "../types";
|
|
3
|
+
export declare class MindsResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
6
|
+
/**
|
|
7
|
+
* List all minds
|
|
8
|
+
*/
|
|
9
|
+
list(params: ListMindsParams): Promise<Mind[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Create a new mind
|
|
12
|
+
*/
|
|
13
|
+
create(data: CreateMindRequest): Promise<Mind>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a specific mind by ID
|
|
16
|
+
*/
|
|
17
|
+
get(mindId: string): Promise<Mind>;
|
|
18
|
+
/**
|
|
19
|
+
* Update a specific mind by ID
|
|
20
|
+
*/
|
|
21
|
+
update(mindId: string, data: UpdateMindRequest): Promise<Mind>;
|
|
22
|
+
/**
|
|
23
|
+
* Delete a mind by ID
|
|
24
|
+
*/
|
|
25
|
+
delete(mindId: string): Promise<{
|
|
26
|
+
success: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Search minds
|
|
30
|
+
*/
|
|
31
|
+
search(params: SearchMindsParams): Promise<Mind[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Set tags for a mind (Replace existing)
|
|
34
|
+
*/
|
|
35
|
+
setTags(mindId: string, data: {
|
|
36
|
+
tags: string[];
|
|
37
|
+
}): Promise<Mind>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=minds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minds.d.ts","sourceRoot":"","sources":["../../src/resources/minds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,IAAI,EACJ,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEzC;;OAEG;IACG,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAapD;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAapD;;OAEG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxC;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAepE;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAK3D;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAOxD;;OAEG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAMvE"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MindsResource = void 0;
|
|
4
|
+
class MindsResource {
|
|
5
|
+
client;
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* List all minds
|
|
11
|
+
*/
|
|
12
|
+
async list(params) {
|
|
13
|
+
const query = {};
|
|
14
|
+
if (params?.tags && params.tags?.length > 0) {
|
|
15
|
+
query.tagNames = params.tags.join(",");
|
|
16
|
+
}
|
|
17
|
+
const response = await this.client.get("/minds", {
|
|
18
|
+
params: query,
|
|
19
|
+
});
|
|
20
|
+
return response.data.minds;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a new mind
|
|
24
|
+
*/
|
|
25
|
+
async create(data) {
|
|
26
|
+
let createTags;
|
|
27
|
+
if (data?.tags && data?.tags?.length > 0) {
|
|
28
|
+
createTags = data.tags.join(",");
|
|
29
|
+
}
|
|
30
|
+
const response = await this.client.post("/minds", {
|
|
31
|
+
...data,
|
|
32
|
+
tags: createTags,
|
|
33
|
+
});
|
|
34
|
+
return response.data.mind;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get a specific mind by ID
|
|
38
|
+
*/
|
|
39
|
+
async get(mindId) {
|
|
40
|
+
const response = await this.client.get(`/minds/${mindId}`);
|
|
41
|
+
return response.data;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Update a specific mind by ID
|
|
45
|
+
*/
|
|
46
|
+
async update(mindId, data) {
|
|
47
|
+
let updateTags;
|
|
48
|
+
// The API expects tags as a comma-separated string
|
|
49
|
+
if (data?.tags) {
|
|
50
|
+
updateTags = data.tags.join(",");
|
|
51
|
+
}
|
|
52
|
+
const response = await this.client.put(`/minds/${mindId}`, {
|
|
53
|
+
...data,
|
|
54
|
+
tags: updateTags,
|
|
55
|
+
});
|
|
56
|
+
return response.data.mind;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Delete a mind by ID
|
|
60
|
+
*/
|
|
61
|
+
async delete(mindId) {
|
|
62
|
+
const response = await this.client.delete(`/minds/${mindId}`);
|
|
63
|
+
return response.data;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Search minds
|
|
67
|
+
*/
|
|
68
|
+
async search(params) {
|
|
69
|
+
const response = await this.client.get("/minds/search", {
|
|
70
|
+
params,
|
|
71
|
+
});
|
|
72
|
+
return response.data.minds;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Set tags for a mind (Replace existing)
|
|
76
|
+
*/
|
|
77
|
+
async setTags(mindId, data) {
|
|
78
|
+
const response = await this.client.put(`/minds/${mindId}/tags`, {
|
|
79
|
+
tagNames: data.tags,
|
|
80
|
+
});
|
|
81
|
+
return response.data.mind;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.MindsResource = MindsResource;
|
|
85
|
+
//# sourceMappingURL=minds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minds.js","sourceRoot":"","sources":["../../src/resources/minds.ts"],"names":[],"mappings":";;;AASA,MAAa,aAAa;IACJ;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAAuB;QAChC,MAAM,KAAK,GAA8B,EAAE,CAAC;QAE5C,IAAI,MAAM,EAAE,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5C,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAoB,QAAQ,EAAE;YAClE,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,IAAuB;QAClC,IAAI,UAA8B,CAAC;QAEnC,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;YACzC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,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H,KAAK,CAAC,OAAO,CAAC,MAAc,EAAE,IAAwB;QACpD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAiB,UAAU,MAAM,OAAO,EAAE;YAC9E,QAAQ,EAAE,IAAI,CAAC,IAAI;SACpB,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAC5B,CAAC;CACF;AAxFD,sCAwFC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AxiosInstance } from "axios";
|
|
2
|
+
import type { GetPsychometricsResponse } from "../types";
|
|
3
|
+
export declare class PsychometricsResource {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: AxiosInstance);
|
|
6
|
+
/**
|
|
7
|
+
* Get psychometrics for a specific snapshot
|
|
8
|
+
*/
|
|
9
|
+
get(snapshotId: string): Promise<GetPsychometricsResponse>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=psychometrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"psychometrics.d.ts","sourceRoot":"","sources":["../../src/resources/psychometrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,qBAAa,qBAAqB;IACpB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEzC;;OAEG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAMjE"}
|