epismo 1.3.0 → 1.5.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 +72 -74
- package/npm/bin/epismo.js +10 -0
- package/npm/launcher.js +104 -0
- package/npm/vendor/darwin-amd64/epismo +0 -0
- package/npm/vendor/darwin-arm64/epismo +0 -0
- package/npm/vendor/linux-amd64/epismo +0 -0
- package/npm/vendor/linux-arm64/epismo +0 -0
- package/npm/vendor/windows-amd64/epismo.exe +0 -0
- package/npm/vendor/windows-arm64/epismo.exe +0 -0
- package/package.json +39 -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,111 @@
|
|
|
1
1
|
# Epismo CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Native command-line interface for [Epismo](https://epismo.ai). It is written in Go and returns JSON, making it useful in terminals, scripts, and agent workflows.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
macOS and Linux:
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
# or
|
|
12
|
-
npx epismo <command>
|
|
9
|
+
```sh
|
|
10
|
+
curl -fsSL https://epismo.ai/install.sh | sh
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
Windows PowerShell:
|
|
16
14
|
|
|
17
|
-
```
|
|
18
|
-
epismo
|
|
19
|
-
epismo login --email you@example.com
|
|
20
|
-
epismo whoami
|
|
21
|
-
epismo logout
|
|
15
|
+
```powershell
|
|
16
|
+
irm https://epismo.ai/install.ps1 | iex
|
|
22
17
|
```
|
|
23
18
|
|
|
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>`.
|
|
19
|
+
Or install with Go or npm:
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
```sh
|
|
22
|
+
go install github.com/epismoai/cli/cmd/epismo@latest
|
|
23
|
+
npm install -g epismo
|
|
24
|
+
```
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
epismo login | logout | whoami
|
|
26
|
+
Prebuilt archives, standalone executables, and `checksums.txt` are available from [GitHub Releases](https://github.com/epismoai/cli/releases).
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
epismo workspace member list | upsert | delete
|
|
35
|
-
epismo project list | create | update
|
|
36
|
-
epismo project member list | add | delete
|
|
37
|
-
epismo credit balance | checkout
|
|
38
|
-
epismo token create
|
|
28
|
+
## Updating
|
|
39
29
|
|
|
40
|
-
|
|
41
|
-
epismo playbook version list | get | publish
|
|
42
|
-
epismo playbook share <playbook-id>
|
|
43
|
-
epismo alias set | list | delete
|
|
30
|
+
The CLI checks GitHub Releases for a newer version at most once every 24 hours in interactive terminals. When an update is available, run:
|
|
44
31
|
|
|
45
|
-
|
|
46
|
-
epismo
|
|
47
|
-
|
|
32
|
+
```sh
|
|
33
|
+
epismo update
|
|
34
|
+
```
|
|
48
35
|
|
|
49
|
-
|
|
36
|
+
The command identifies how the active executable was installed and returns the appropriate installation command; it never modifies the executable itself. Default shell installations receive the short command shown above. A custom installation directory is included only when needed. Go and global Node installations receive a manager-specific command when the package manager can be identified. Yarn's global command is returned only for Yarn Classic because modern Yarn does not support that workflow. Set `EPISMO_UPDATE_CHECK=0` to disable automatic checks.
|
|
37
|
+
|
|
38
|
+
The npm package contains a dependency-free JavaScript launcher and all supported native binaries. It uses no lifecycle installation scripts and performs no additional downloads during installation. The launcher selects the binary for the current platform and passes its package-manager context to the native CLI. Shell and PowerShell installers write an installation receipt next to the executable; Go installations are identified from embedded build metadata. If the method cannot be determined safely, `epismo update` links to the update instructions without modifying the executable.
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
epismo login
|
|
44
|
+
epismo workspace list
|
|
45
|
+
epismo workspace use WORKSPACE_ID # optional: save a default workspace
|
|
46
|
+
epismo playbook search --query onboarding
|
|
50
47
|
```
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
available through MCP. MCP names mirror the CLI resource/verb hierarchy in snake_case;
|
|
54
|
-
for example, `epismo_playbook_version_list` maps to `epismo playbook version list`.
|
|
49
|
+
Run `epismo --help` for command groups, or append `--help` to any group or command for its options.
|
|
55
50
|
|
|
56
|
-
|
|
51
|
+
## Output and input
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
Successful commands write JSON to stdout; warnings and errors write JSON to stderr. This keeps output easy to use from scripts and agents.
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"error": {
|
|
58
|
+
"code": "NOT_FOUND",
|
|
59
|
+
"message": "...",
|
|
60
|
+
"retryable": false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Commands that accept a request body support inline JSON, a file, or stdin:
|
|
61
66
|
|
|
62
|
-
```
|
|
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
|
-
`--input
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
Explicit flags override fields supplied through `--input`. Mutations create an idempotency key automatically unless you provide `--idempotency-key` or `idempotencyKey` in the input.
|
|
73
|
+
|
|
74
|
+
## Authentication and configuration
|
|
75
|
+
|
|
76
|
+
`epismo login` opens a browser-based OAuth login. With `--email`, it automatically uses your organization SSO when available, otherwise it prompts for an email code.
|
|
71
77
|
|
|
72
|
-
|
|
73
|
-
Case's own input object through `--case-input` instead:
|
|
78
|
+
For CI or other non-interactive use, create a workspace-scoped token and pass it with `EPISMO_TOKEN`:
|
|
74
79
|
|
|
75
|
-
```
|
|
76
|
-
epismo
|
|
77
|
-
|
|
80
|
+
```sh
|
|
81
|
+
epismo token create --workspace-id WORKSPACE_ID
|
|
82
|
+
EPISMO_TOKEN=... epismo playbook search
|
|
78
83
|
```
|
|
79
84
|
|
|
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.
|
|
85
|
+
Configuration is stored in `~/.epismo` (compatible with the original npm CLI). Set `EPISMO_CONFIG_DIR` to use a different directory. For local API development, set `APP_ENV=dev`, or override `EPISMO_API_URL` and `EPISMO_WEB_URL`.
|
|
83
86
|
|
|
84
|
-
|
|
85
|
-
most recent object returned by the API: `case assign | acl | update | close | reopen`
|
|
86
|
-
and `task assign | update | close | reopen`. After a conflict, re-read the object and
|
|
87
|
-
decide again rather than resending with a bumped number. Updates are partial: Case
|
|
88
|
-
currently supports `title`, while Task supports `title` and `instructions`.
|
|
87
|
+
## API contract
|
|
89
88
|
|
|
90
|
-
`
|
|
91
|
-
Use `--case-id`, `--task-id`, `--created-by`, `--kinds`, `--origins`, or `--acl` to
|
|
92
|
-
narrow it; these filters never grant access. Results default to newest first, and
|
|
93
|
-
`--order asc` walks a timeline forward.
|
|
89
|
+
[`contracts/openapi.json`](contracts/openapi.json) is a generated snapshot of Epismo's public OpenAPI 3.1 contract. Refresh it after an API deployment:
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
```sh
|
|
92
|
+
sh scripts/sync-openapi.sh
|
|
93
|
+
```
|
|
96
94
|
|
|
97
|
-
|
|
98
|
-
as `epismo playbook search --query` values. Search resolves a `pb:` reference before
|
|
99
|
-
full-text search; when a bare `pb:<alias>` is outside the caller's own namespaces, it
|
|
100
|
-
falls back to searching readable Playbooks for that alias. Aliases are managed with
|
|
101
|
-
`epismo alias`.
|
|
95
|
+
Do not edit the snapshot manually. Its `info.version` represents API compatibility (for example, `1.0.0` for `/v1`), not the CLI release version. Contract tests ensure remote commands and query options remain compatible with the API.
|
|
102
96
|
|
|
103
|
-
##
|
|
97
|
+
## Develop
|
|
104
98
|
|
|
105
|
-
|
|
106
|
-
- Failure: JSON on stderr and a non-zero exit code.
|
|
107
|
-
- Non-interactive commands fail instead of waiting for an unavailable prompt.
|
|
99
|
+
The CLI runtime uses only the Go standard library.
|
|
108
100
|
|
|
109
|
-
```
|
|
110
|
-
|
|
101
|
+
```sh
|
|
102
|
+
go test -race ./...
|
|
103
|
+
go vet ./...
|
|
104
|
+
go build ./cmd/epismo
|
|
111
105
|
```
|
|
112
106
|
|
|
113
|
-
|
|
107
|
+
Releases are built for macOS, Linux, and Windows from semantic-version tags such as `v1.3.1`. The tag is the release version source; the development `package.json` version is intentionally not updated.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
[Apache License 2.0](LICENSE).
|
package/npm/launcher.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
3
|
+
import { dirname, join, parse, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
|
|
8
|
+
export function targetFor(platform = process.platform, architecture = process.arch) {
|
|
9
|
+
const os = { darwin: "darwin", linux: "linux", win32: "windows" }[platform];
|
|
10
|
+
const arch = { x64: "amd64", arm64: "arm64" }[architecture];
|
|
11
|
+
return os && arch ? `${os}-${arch}` : null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function binaryFor(platform = process.platform, architecture = process.arch, root = packageRoot) {
|
|
15
|
+
const target = targetFor(platform, architecture);
|
|
16
|
+
if (!target) return null;
|
|
17
|
+
return join(root, "npm", "vendor", target, platform === "win32" ? "epismo.exe" : "epismo");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function detectPackageManager({
|
|
21
|
+
root = packageRoot,
|
|
22
|
+
entrypoint = process.argv[1] || "",
|
|
23
|
+
userAgent = process.env.npm_config_user_agent || "",
|
|
24
|
+
execPath = process.env.npm_execpath || ""
|
|
25
|
+
} = {}) {
|
|
26
|
+
if (pnpmOwnsPackage(root, entrypoint)) return { name: "pnpm", version: versionFromUserAgent(userAgent, "pnpm") };
|
|
27
|
+
const normalizedRoot = root.toLowerCase().replaceAll("\\", "/");
|
|
28
|
+
if (/\bbun\//i.test(userAgent) || /(?:^|[\\/])bun(?:\.exe)?$/i.test(execPath) || normalizedRoot.includes("/.bun/install/global/")) {
|
|
29
|
+
return { name: "bun", version: versionFromUserAgent(userAgent, "bun") };
|
|
30
|
+
}
|
|
31
|
+
if (/\byarn\//i.test(userAgent) || /(?:^|[\\/])yarn(?:\.c?js|\.cmd)?$/i.test(execPath) || normalizedRoot.includes("/.config/yarn/global/")) {
|
|
32
|
+
return { name: "yarn", version: versionFromUserAgent(userAgent, "yarn") || "1" };
|
|
33
|
+
}
|
|
34
|
+
return { name: "npm", version: versionFromUserAgent(userAgent, "npm") };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function installationScope(environment = process.env) {
|
|
38
|
+
return environment.npm_command === "exec" || environment.npm_lifecycle_event === "npx" ? "ephemeral" : "global";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function launch() {
|
|
42
|
+
const binary = binaryFor();
|
|
43
|
+
if (!binary) {
|
|
44
|
+
throw new Error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
45
|
+
}
|
|
46
|
+
if (!existsSync(binary)) {
|
|
47
|
+
throw new Error(`Epismo native binary is missing for ${process.platform}-${process.arch}. Reinstall the epismo package.`);
|
|
48
|
+
}
|
|
49
|
+
const manager = detectPackageManager();
|
|
50
|
+
const env = {
|
|
51
|
+
...process.env,
|
|
52
|
+
EPISMO_DISTRIBUTION: "node",
|
|
53
|
+
EPISMO_NODE_MANAGER: manager.name,
|
|
54
|
+
EPISMO_NODE_MANAGER_VERSION: manager.version || "",
|
|
55
|
+
EPISMO_NODE_SCOPE: installationScope()
|
|
56
|
+
};
|
|
57
|
+
const child = spawn(binary, process.argv.slice(2), { stdio: "inherit", env });
|
|
58
|
+
const signalHandlers = new Map();
|
|
59
|
+
const removeSignalHandlers = () => {
|
|
60
|
+
for (const [signal, handler] of signalHandlers) process.off(signal, handler);
|
|
61
|
+
};
|
|
62
|
+
child.on("error", (error) => {
|
|
63
|
+
removeSignalHandlers();
|
|
64
|
+
console.error(error.message);
|
|
65
|
+
process.exitCode = 1;
|
|
66
|
+
});
|
|
67
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
68
|
+
const handler = () => {
|
|
69
|
+
if (!child.killed) child.kill(signal);
|
|
70
|
+
};
|
|
71
|
+
signalHandlers.set(signal, handler);
|
|
72
|
+
process.on(signal, handler);
|
|
73
|
+
}
|
|
74
|
+
child.on("exit", (code, signal) => {
|
|
75
|
+
removeSignalHandlers();
|
|
76
|
+
if (signal && process.platform !== "win32") {
|
|
77
|
+
process.kill(process.pid, signal);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
process.exitCode = code ?? 1;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function versionFromUserAgent(userAgent, manager) {
|
|
85
|
+
return userAgent.match(new RegExp(`(?:^|\\s)${manager}/([^\\s]+)`, "i"))?.[1] || "";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function pnpmOwnsPackage(root, entrypoint) {
|
|
89
|
+
for (const start of new Set([root, dirname(resolve(entrypoint || root))])) {
|
|
90
|
+
const filesystemRoot = parse(start).root;
|
|
91
|
+
for (let current = start; ; current = dirname(current)) {
|
|
92
|
+
const nodeModules = join(current, "node_modules");
|
|
93
|
+
if (existsSync(join(nodeModules, ".modules.yaml"))) {
|
|
94
|
+
try {
|
|
95
|
+
if (realpathSync(join(nodeModules, "epismo")) === realpathSync(root)) return true;
|
|
96
|
+
} catch {
|
|
97
|
+
// Keep looking for the owning pnpm node_modules directory.
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (current === filesystemRoot) break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
2
|
+
"name": "epismo",
|
|
3
|
+
"version": "1.5.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://epismo.ai",
|
|
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
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"epismo": "npm/bin/epismo.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"npm/bin/epismo.js",
|
|
28
|
+
"npm/launcher.js",
|
|
29
|
+
"npm/vendor/darwin-amd64/epismo",
|
|
30
|
+
"npm/vendor/darwin-arm64/epismo",
|
|
31
|
+
"npm/vendor/linux-amd64/epismo",
|
|
32
|
+
"npm/vendor/linux-arm64/epismo",
|
|
33
|
+
"npm/vendor/windows-amd64/epismo.exe",
|
|
34
|
+
"npm/vendor/windows-arm64/epismo.exe",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "node --test npm/launcher.test.js"
|
|
40
|
+
}
|
|
40
41
|
}
|
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"}
|