epismo 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +84 -75
- package/npm/bin/epismo.exe +1 -0
- package/npm/install.js +82 -0
- package/package.json +30 -38
- package/dist/analytics.js +0 -44
- package/dist/analytics.js.map +0 -1
- package/dist/api.js +0 -111
- package/dist/api.js.map +0 -1
- package/dist/auth.js +0 -658
- package/dist/auth.js.map +0 -1
- package/dist/bin.js +0 -3
- package/dist/bin.js.map +0 -1
- package/dist/cases.js +0 -25
- package/dist/cases.js.map +0 -1
- package/dist/config.js +0 -109
- package/dist/config.js.map +0 -1
- package/dist/context.js +0 -16
- package/dist/context.js.map +0 -1
- package/dist/credits.js +0 -31
- package/dist/credits.js.map +0 -1
- package/dist/errors.js +0 -111
- package/dist/errors.js.map +0 -1
- package/dist/index.js +0 -36
- package/dist/index.js.map +0 -1
- package/dist/input.js +0 -211
- package/dist/input.js.map +0 -1
- package/dist/output.js +0 -10
- package/dist/output.js.map +0 -1
- package/dist/playbook-program.js +0 -470
- package/dist/playbook-program.js.map +0 -1
- package/dist/playbooks.js +0 -62
- package/dist/playbooks.js.map +0 -1
- package/dist/program.js +0 -368
- package/dist/program.js.map +0 -1
- package/dist/projects.js +0 -54
- package/dist/projects.js.map +0 -1
- package/dist/records.js +0 -12
- package/dist/records.js.map +0 -1
- package/dist/suggestions.js +0 -15
- package/dist/suggestions.js.map +0 -1
- package/dist/token.js +0 -10
- package/dist/token.js.map +0 -1
- package/dist/update-check.js +0 -121
- package/dist/update-check.js.map +0 -1
- package/dist/workspace.js +0 -19
- package/dist/workspace.js.map +0 -1
- package/dist/workspaces.js +0 -61
- package/dist/workspaces.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,113 +1,122 @@
|
|
|
1
1
|
# Epismo CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The CLI for [Epismo](https://epismo.ai), implemented in Go and distributed
|
|
4
|
+
as a native executable.
|
|
4
5
|
|
|
5
6
|
## Install
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
macOS and Linux:
|
|
8
9
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
# or
|
|
12
|
-
npx epismo <command>
|
|
10
|
+
```sh
|
|
11
|
+
curl -fsSL https://epismo.ai/install.sh | sh
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
Windows PowerShell:
|
|
16
15
|
|
|
17
|
-
```
|
|
18
|
-
epismo
|
|
19
|
-
epismo login --email you@example.com
|
|
20
|
-
epismo whoami
|
|
21
|
-
epismo logout
|
|
16
|
+
```powershell
|
|
17
|
+
irm https://epismo.ai/install.ps1 | iex
|
|
22
18
|
```
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
`epismo workspace use`, then personal space. A workspace-scoped CI token can be issued
|
|
26
|
-
with `epismo token create --workspace-id <workspace-id>`.
|
|
20
|
+
With Go:
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
```sh
|
|
23
|
+
go install github.com/epismoai/cli/cmd/epismo@latest
|
|
24
|
+
```
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
epismo login | logout | whoami
|
|
26
|
+
With npm:
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
epismo project member list | add | delete
|
|
37
|
-
epismo credit balance | checkout
|
|
38
|
-
epismo token create
|
|
28
|
+
```sh
|
|
29
|
+
npm install -g epismo
|
|
30
|
+
```
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
epismo playbook share <playbook-id>
|
|
43
|
-
epismo alias set | list | delete
|
|
32
|
+
You can also download a platform archive, a raw executable, and `checksums.txt` from
|
|
33
|
+
[GitHub Releases](https://github.com/epismoai/cli/releases).
|
|
44
34
|
|
|
45
|
-
|
|
46
|
-
epismo task create | list | assign | update | close | reopen
|
|
47
|
-
epismo record append | list
|
|
35
|
+
## Usage
|
|
48
36
|
|
|
49
|
-
|
|
37
|
+
```sh
|
|
38
|
+
epismo login
|
|
39
|
+
epismo whoami
|
|
40
|
+
epismo workspace list
|
|
41
|
+
epismo playbook search --query onboarding
|
|
42
|
+
epismo case list --status open
|
|
43
|
+
epismo task list
|
|
44
|
+
epismo suggestion list
|
|
50
45
|
```
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
for example, `epismo_playbook_version_list` maps to `epismo playbook version list`.
|
|
47
|
+
Every successful command writes JSON to stdout. Warnings and errors are JSON on
|
|
48
|
+
stderr, making the CLI suitable for both people and agents.
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"error": {
|
|
53
|
+
"code": "NOT_FOUND",
|
|
54
|
+
"message": "...",
|
|
55
|
+
"retryable": false
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
Use `epismo --help`, `epismo <group> --help`, or
|
|
61
|
+
`epismo <group> <command> --help` for the complete command reference.
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
### Structured input
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
Commands that accept request payloads support inline JSON, files, and stdin:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
63
68
|
epismo playbook create --input @playbook.json
|
|
64
|
-
epismo record append
|
|
65
|
-
epismo suggestion create --input - < suggestion.json
|
|
69
|
+
epismo case record append CASE_ID --input - < record.json
|
|
66
70
|
```
|
|
67
71
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
Explicit command-line options override fields from `--input`. Mutations generate
|
|
73
|
+
an idempotency key unless `--idempotency-key` or an `idempotencyKey` in input is
|
|
74
|
+
provided.
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
Case's own input object through `--case-input` instead:
|
|
76
|
+
### Authentication and configuration
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
--case-input '{"companyName":"Acme"}'
|
|
78
|
-
```
|
|
78
|
+
Interactive login uses OAuth 2.0 Authorization Code with PKCE. Email login
|
|
79
|
+
automatically selects organization SSO or a terminal email-code flow.
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
a UUID automatically. Reuse an explicit key when retrying a command whose first result
|
|
82
|
-
was uncertain; reusing one with different arguments is rejected.
|
|
81
|
+
For CI, issue a token and set it as an environment variable:
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
currently supports `title`, while Task supports `title` and `instructions`.
|
|
83
|
+
```sh
|
|
84
|
+
epismo token create --workspace-id WORKSPACE_ID
|
|
85
|
+
EPISMO_TOKEN=... epismo playbook search
|
|
86
|
+
```
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
Configuration remains compatible with the original npm CLI and is stored under
|
|
89
|
+
`~/.epismo`. Set `EPISMO_CONFIG_DIR` to use another location. For local API
|
|
90
|
+
development, set `APP_ENV=dev`, or override endpoints directly with
|
|
91
|
+
`EPISMO_API_URL` and `EPISMO_WEB_URL`.
|
|
94
92
|
|
|
95
|
-
##
|
|
93
|
+
## API contract
|
|
96
94
|
|
|
97
|
-
The
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
`
|
|
95
|
+
The versioned OpenAPI 3.1 contract used by the CLI is checked in at
|
|
96
|
+
`contracts/openapi.json` as a generated snapshot of the public contract served
|
|
97
|
+
at `https://api.epismo.ai/openapi.json`. After deploying an API change, refresh
|
|
98
|
+
the snapshot with `sh scripts/sync-openapi.sh`; do not edit it manually. Its
|
|
99
|
+
`info.version` identifies the API compatibility generation (`1.0.0` for `/v1`)
|
|
100
|
+
and is independent of the CLI release version. Contract tests verify that every
|
|
101
|
+
remote CLI command uses a documented operation and that its query options remain
|
|
102
|
+
compatible with the API. Releases run the same compatibility checks against the
|
|
103
|
+
deployed contract before publishing.
|
|
102
104
|
|
|
103
|
-
##
|
|
105
|
+
## Develop
|
|
104
106
|
|
|
105
|
-
|
|
106
|
-
- Failure: JSON on stderr and a non-zero exit code.
|
|
107
|
-
- Non-interactive commands fail instead of waiting for an unavailable prompt.
|
|
107
|
+
The runtime uses only the Go standard library.
|
|
108
108
|
|
|
109
|
-
```
|
|
110
|
-
|
|
109
|
+
```sh
|
|
110
|
+
go test -race ./...
|
|
111
|
+
go vet ./...
|
|
112
|
+
go build ./cmd/epismo
|
|
111
113
|
```
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
Releases are built for macOS, Linux, and Windows from semantic-version tags such
|
|
116
|
+
as `v1.3.1`. The tag is the sole source of the release version: the workflow
|
|
117
|
+
injects it into Go binaries and sets the npm package version immediately before
|
|
118
|
+
publishing. The development `package.json` version is intentionally not bumped.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
Apache License 2.0.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Epismo native binary placeholder. The npm postinstall script replaces this file.
|
package/npm/install.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { chmod, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { get } from "node:https";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const repository = "epismoai/cli";
|
|
8
|
+
const packageRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
9
|
+
const target = join(packageRoot, "npm", "bin", "epismo.exe");
|
|
10
|
+
const packageJson = JSON.parse(await readFile(join(packageRoot, "package.json"), "utf8"));
|
|
11
|
+
const version = packageJson.version;
|
|
12
|
+
if (version === "0.0.0-development") {
|
|
13
|
+
console.log("Skipping Epismo binary download for a development checkout.");
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) {
|
|
17
|
+
throw new Error(`Invalid published package version: ${JSON.stringify(version)}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const platform = { darwin: "darwin", linux: "linux", win32: "windows" }[process.platform];
|
|
21
|
+
const architecture = { x64: "amd64", arm64: "arm64" }[process.arch];
|
|
22
|
+
if (!platform || !architecture) {
|
|
23
|
+
throw new Error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const extension = platform === "windows" ? ".exe" : "";
|
|
27
|
+
const asset = `epismo_${platform}_${architecture}${extension}`;
|
|
28
|
+
const releaseBase = process.env.EPISMO_RELEASE_BASE_URL || `https://github.com/${repository}/releases/download/v${version}`;
|
|
29
|
+
const [binary, checksumFile] = await Promise.all([
|
|
30
|
+
download(`${releaseBase}/${asset}`),
|
|
31
|
+
download(`${releaseBase}/checksums.txt`)
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
const expected = checksumFile
|
|
35
|
+
.toString("utf8")
|
|
36
|
+
.split(/\r?\n/)
|
|
37
|
+
.map((line) => line.trim().split(/\s+/))
|
|
38
|
+
.find((parts) => parts[1] === asset)?.[0];
|
|
39
|
+
if (!expected) {
|
|
40
|
+
throw new Error(`Checksum not found for ${asset}`);
|
|
41
|
+
}
|
|
42
|
+
const actual = createHash("sha256").update(binary).digest("hex");
|
|
43
|
+
if (actual !== expected.toLowerCase()) {
|
|
44
|
+
throw new Error(`Checksum verification failed for ${asset}`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const temporary = `${target}.${process.pid}.tmp`;
|
|
48
|
+
await writeFile(temporary, binary, { mode: 0o755 });
|
|
49
|
+
await chmod(temporary, 0o755).catch(() => {});
|
|
50
|
+
await rm(target, { force: true });
|
|
51
|
+
await rename(temporary, target);
|
|
52
|
+
|
|
53
|
+
function download(url, redirects = 0) {
|
|
54
|
+
if (redirects > 5) {
|
|
55
|
+
return Promise.reject(new Error(`Too many redirects while downloading ${url}`));
|
|
56
|
+
}
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
const request = get(url, { headers: { "user-agent": `epismo-npm/${version}` } }, (response) => {
|
|
59
|
+
if (response.statusCode && response.statusCode >= 300 && response.statusCode < 400) {
|
|
60
|
+
const location = response.headers.location;
|
|
61
|
+
response.resume();
|
|
62
|
+
if (!location) {
|
|
63
|
+
reject(new Error(`Redirect without Location from ${url}`));
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
resolve(download(new URL(location, url).toString(), redirects + 1));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (response.statusCode !== 200) {
|
|
70
|
+
response.resume();
|
|
71
|
+
reject(new Error(`Download failed (${response.statusCode}) for ${url}`));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const chunks = [];
|
|
75
|
+
response.on("data", (chunk) => chunks.push(chunk));
|
|
76
|
+
response.on("end", () => resolve(Buffer.concat(chunks)));
|
|
77
|
+
response.on("error", reject);
|
|
78
|
+
});
|
|
79
|
+
request.setTimeout(30_000, () => request.destroy(new Error(`Download timed out: ${url}`)));
|
|
80
|
+
request.on("error", reject);
|
|
81
|
+
});
|
|
82
|
+
}
|
package/package.json
CHANGED
|
@@ -1,40 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"build": "npm run clean && tsc -p tsconfig.json && chmod +x dist/bin.js",
|
|
33
|
-
"prepack": "npm run build",
|
|
34
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
35
|
-
"lint": "eslint ."
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"commander": "^15.0.0"
|
|
39
|
-
}
|
|
2
|
+
"name": "epismo",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Dependency-free CLI for discovering, authoring, and coordinating reusable AI Playbooks.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"homepage": "https://github.com/epismoai/cli",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/epismoai/cli.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": "https://github.com/epismoai/cli/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"epismo",
|
|
15
|
+
"playbook",
|
|
16
|
+
"workflow",
|
|
17
|
+
"agent",
|
|
18
|
+
"cli"
|
|
19
|
+
],
|
|
20
|
+
"bin": {
|
|
21
|
+
"epismo": "npm/bin/epismo.exe"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"npm/bin/epismo.exe",
|
|
25
|
+
"npm/install.js",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"postinstall": "node npm/install.js"
|
|
31
|
+
}
|
|
40
32
|
}
|
package/dist/analytics.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import crypto from "node:crypto";
|
|
2
|
-
export const ObjectTypes = {
|
|
3
|
-
pack: "pack",
|
|
4
|
-
workflow: "workflow",
|
|
5
|
-
context: "context",
|
|
6
|
-
track: "track",
|
|
7
|
-
task: "task",
|
|
8
|
-
goal: "goal",
|
|
9
|
-
alias: "alias",
|
|
10
|
-
session: "session",
|
|
11
|
-
workspace: "workspace",
|
|
12
|
-
project: "project",
|
|
13
|
-
credit: "credit"
|
|
14
|
-
};
|
|
15
|
-
export function uuidv7() {
|
|
16
|
-
const ms = Date.now();
|
|
17
|
-
const random = crypto.randomBytes(10);
|
|
18
|
-
const bytes = Buffer.allocUnsafe(16);
|
|
19
|
-
bytes[0] = (ms / 2 ** 40) & 0xff;
|
|
20
|
-
bytes[1] = (ms / 2 ** 32) & 0xff;
|
|
21
|
-
bytes[2] = (ms / 2 ** 24) & 0xff;
|
|
22
|
-
bytes[3] = (ms / 2 ** 16) & 0xff;
|
|
23
|
-
bytes[4] = (ms / 2 ** 8) & 0xff;
|
|
24
|
-
bytes[5] = ms & 0xff;
|
|
25
|
-
bytes[6] = 0x70 | (random[0] & 0x0f);
|
|
26
|
-
bytes[7] = random[1];
|
|
27
|
-
bytes[8] = 0x80 | (random[2] & 0x3f);
|
|
28
|
-
bytes.set(random.subarray(3), 9);
|
|
29
|
-
const hex = bytes.toString("hex");
|
|
30
|
-
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* No-op analytics service. The CLI deliberately does not emit events directly —
|
|
34
|
-
* events are emitted server-side by the API using the CLI's explicit source header.
|
|
35
|
-
* `identify()` is kept as a future hook for any client-only metadata.
|
|
36
|
-
*/
|
|
37
|
-
export const analytics = {
|
|
38
|
-
recordEvent: () => { },
|
|
39
|
-
identify: () => { }
|
|
40
|
-
};
|
|
41
|
-
export async function flushAnalytics() {
|
|
42
|
-
return Promise.resolve();
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=analytics.js.map
|
package/dist/analytics.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAgBjC,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACP,CAAC;AAEX,MAAM,UAAU,MAAM;IACrB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACtB,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACrC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACrC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACrB,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACrC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAEjC,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;AAC5G,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAqB;IAC1C,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;IACrB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;CAClB,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc;IACnC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AAC1B,CAAC"}
|