@tryaura/aura-cli 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/LICENSE +202 -0
- package/README.md +11 -0
- package/content/mcp/atlassian-rovo.json +14 -0
- package/content/mcp/github.json +23 -0
- package/content/mcp/sentry.json +23 -0
- package/content/snippets/ask-before-destructive.md +8 -0
- package/content/snippets/commit-conventions.md +8 -0
- package/content/snippets/confluence-references.md +8 -0
- package/content/snippets/jira-linking.md +8 -0
- package/content/snippets/pr-descriptions.md +8 -0
- package/content/snippets/python-style.md +8 -0
- package/content/snippets/typescript-style.md +8 -0
- package/dist/bin/aura.d.ts +1 -0
- package/dist/bin/aura.js +17 -0
- package/dist/index.d.ts +152 -0
- package/dist/index.js +140 -0
- package/dist/plugins/index.d.ts +14 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins-n3DS8XXi.js +5684 -0
- package/dist/run-pMPxJqFQ.js +13367 -0
- package/dist/skill-deployment-plan-C4GTrVSy.js +1996 -0
- package/dist/types-DmBu6g0d.d.ts +84 -0
- package/package.json +73 -0
- package/schema/check-output-v1.schema.json +261 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `@tryaura/aura-cli`
|
|
2
|
+
|
|
3
|
+
Composable CLI runtime for Aura distributions. The package exports `runCli` from its root and the
|
|
4
|
+
official plugin composition from `@tryaura/aura-cli/plugins`. Installing it globally also provides
|
|
5
|
+
the official `aura` command.
|
|
6
|
+
|
|
7
|
+
The packages are prepared at `0.1.0` but are not published to npm yet. Until the first release,
|
|
8
|
+
use the repository's `pnpm verify:packages` command to build and exercise local tarballs.
|
|
9
|
+
|
|
10
|
+
See the [distro authoring guide](https://tryaura.sh/docs/guides/distributions) for branding, plugin
|
|
11
|
+
composition, distribution defaults, bundled runtime presets, compiled binaries, and testkit usage.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "official/atlassian-rovo",
|
|
4
|
+
"name": "Atlassian Rovo",
|
|
5
|
+
"serverName": "atlassian-rovo",
|
|
6
|
+
"description": "Connect Atlassian Rovo to Jira and Confluence through Atlassian OAuth.",
|
|
7
|
+
"docsUrl": "https://support.atlassian.com/atlassian-rovo-mcp-server/docs/setting-up-ides/",
|
|
8
|
+
"credentialEnv": [],
|
|
9
|
+
"supportedApps": ["claude-code", "codex", "cursor"],
|
|
10
|
+
"transportTemplate": {
|
|
11
|
+
"type": "http",
|
|
12
|
+
"url": "https://mcp.atlassian.com/v1/mcp/authv2"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "official/github",
|
|
4
|
+
"name": "GitHub",
|
|
5
|
+
"serverName": "github",
|
|
6
|
+
"description": "Connect GitHub repositories, issues, and pull requests with a personal token.",
|
|
7
|
+
"docsUrl": "https://github.com/github/github-mcp-server",
|
|
8
|
+
"credentialEnv": [
|
|
9
|
+
{
|
|
10
|
+
"name": "GITHUB_PERSONAL_ACCESS_TOKEN",
|
|
11
|
+
"description": "A GitHub personal access token with access to the repositories Aura should expose.",
|
|
12
|
+
"setupUrl": "https://github.com/settings/personal-access-tokens"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"supportedApps": ["claude-code", "codex", "cursor"],
|
|
16
|
+
"transportTemplate": {
|
|
17
|
+
"type": "http",
|
|
18
|
+
"url": "https://api.githubcopilot.com/mcp/",
|
|
19
|
+
"headers": {
|
|
20
|
+
"Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "official/sentry",
|
|
4
|
+
"name": "Sentry",
|
|
5
|
+
"serverName": "sentry",
|
|
6
|
+
"description": "Connect Sentry projects, issues, and telemetry with an auth token.",
|
|
7
|
+
"docsUrl": "https://github.com/getsentry/sentry-mcp/blob/main/README.md",
|
|
8
|
+
"credentialEnv": [
|
|
9
|
+
{
|
|
10
|
+
"name": "SENTRY_ACCESS_TOKEN",
|
|
11
|
+
"description": "A Sentry auth token with access to the organizations and projects Aura should expose.",
|
|
12
|
+
"setupUrl": "https://sentry.io/settings/account/api/auth-tokens/"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"supportedApps": ["claude-code", "cursor"],
|
|
16
|
+
"transportTemplate": {
|
|
17
|
+
"type": "http",
|
|
18
|
+
"url": "https://mcp.sentry.dev/mcp",
|
|
19
|
+
"headers": {
|
|
20
|
+
"Authorization": "Sentry-Bearer ${SENTRY_ACCESS_TOKEN}"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Ask before destructive operations
|
|
2
|
+
|
|
3
|
+
- Ask for confirmation before deleting files, discarding changes, rewriting history, force-pushing, or applying irreversible migrations.
|
|
4
|
+
- Name the exact targets and likely impact before requesting confirmation.
|
|
5
|
+
- Prefer a recoverable operation when it meets the same goal.
|
|
6
|
+
- Confirm that backups or rollback steps exist before changing durable data.
|
|
7
|
+
- Never bypass validation hooks or safety checks to make an operation succeed.
|
|
8
|
+
- Stop when the target or scope is ambiguous and request clarification.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Commit conventions
|
|
2
|
+
|
|
3
|
+
- Use the conventional commit form `type(scope): subject`, omitting the scope when it adds no value.
|
|
4
|
+
- Write the subject in the imperative mood and keep it concise.
|
|
5
|
+
- Choose a type that describes the change, such as `feat`, `fix`, `docs`, `refactor`, `test`, or `chore`.
|
|
6
|
+
- Add a body when the reason or tradeoff is not obvious from the subject.
|
|
7
|
+
- Explain why the change is needed instead of repeating the diff.
|
|
8
|
+
- Mark breaking changes clearly and describe the required migration.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Confluence references
|
|
2
|
+
|
|
3
|
+
- Link a Confluence page when it is the canonical source for long-lived requirements, decisions, or operational knowledge.
|
|
4
|
+
- Keep execution-critical constraints and acceptance criteria inline with the current task.
|
|
5
|
+
- Introduce every link with the page title and the reason it matters.
|
|
6
|
+
- Prefer a stable canonical page over search results, temporary notes, or duplicate pages.
|
|
7
|
+
- Summarize the relevant section when readers may not have access to the page.
|
|
8
|
+
- Update or remove a reference when its target is obsolete or superseded.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Jira issue linking
|
|
2
|
+
|
|
3
|
+
- Include the exact Jira issue key in the branch name and commit subject when work belongs to an issue.
|
|
4
|
+
- Preserve the issue key's uppercase project prefix and numeric identifier.
|
|
5
|
+
- Use one primary issue key and identify secondary issues as related work.
|
|
6
|
+
- Link the primary Jira issue from the pull request description.
|
|
7
|
+
- Keep the issue key visible when squashing or rewriting commits.
|
|
8
|
+
- Omit an issue key when the work has no associated Jira issue instead of inventing one.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Pull request descriptions
|
|
2
|
+
|
|
3
|
+
- Structure every pull request description with `What`, `Why`, and `How tested` sections.
|
|
4
|
+
- Summarize the user-visible or system-visible outcome under `What`.
|
|
5
|
+
- Explain the motivation, constraints, and important tradeoffs under `Why`.
|
|
6
|
+
- List the exact automated and manual validation performed under `How tested`.
|
|
7
|
+
- Link the primary issue and note any related or follow-up work.
|
|
8
|
+
- Call out migrations, rollout requirements, known limitations, and screenshots when relevant.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Python style
|
|
2
|
+
|
|
3
|
+
- Add type hints to public functions, methods, and module-level values whose type is not obvious.
|
|
4
|
+
- Model optional and union values explicitly instead of relying on implicit `None` handling.
|
|
5
|
+
- Run Ruff formatting and lint checks using the repository's configuration.
|
|
6
|
+
- Fix lint findings at their source instead of adding blanket ignores.
|
|
7
|
+
- Keep imports ordered and remove unused imports.
|
|
8
|
+
- Prefer small typed interfaces over loosely structured dictionaries at module boundaries.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# TypeScript style
|
|
2
|
+
|
|
3
|
+
- Enable strict compiler checks and preserve them in new code.
|
|
4
|
+
- Model unknown input explicitly and narrow it before use.
|
|
5
|
+
- Avoid `any`, unchecked type assertions, and non-null assertions.
|
|
6
|
+
- Declare explicit return types on exported functions and methods.
|
|
7
|
+
- Prefer discriminated unions and exhaustive control flow for variant data.
|
|
8
|
+
- Preserve immutability with readonly types where mutation is unnecessary.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/bin/aura.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { n as OFFICIAL_REGISTRY_OPTIONS, t as OFFICIAL_PLUGINS } from "../plugins-n3DS8XXi.js";
|
|
3
|
+
import { t as runCli } from "../run-pMPxJqFQ.js";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/bin.ts
|
|
6
|
+
await runCli({
|
|
7
|
+
branding: {
|
|
8
|
+
command: "aura",
|
|
9
|
+
description: "Agent Unification & Repair Assistant",
|
|
10
|
+
displayName: "Aura",
|
|
11
|
+
version: "0.1.0"
|
|
12
|
+
},
|
|
13
|
+
plugins: OFFICIAL_PLUGINS,
|
|
14
|
+
registry: OFFICIAL_REGISTRY_OPTIONS
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { a as CliRuntime, i as CliRegistryOptions, n as CliDistro, r as CliExitCode, t as CliBranding } from "./types-DmBu6g0d.js";
|
|
2
|
+
import { AdapterSupport, AuraConfigurationProvenance, FindingLocation, FindingPresentation, Fixability, HttpFailureReason, HttpPostRequest, HttpPostResult, JsonObject, Scope, Severity, TelemetryEvent, TelemetrySink, TelemetrySink as TelemetrySink$1 } from "@tryaura/aura-sdk";
|
|
3
|
+
//#region src/http-telemetry-sink.d.ts
|
|
4
|
+
/** A privacy-safe reason one HTTP delivery was dropped. */
|
|
5
|
+
type HttpTelemetryDeliveryFailure = {
|
|
6
|
+
readonly kind: "http-status";
|
|
7
|
+
readonly status: number;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: "transport";
|
|
10
|
+
readonly reason: HttpFailureReason | "rejected";
|
|
11
|
+
};
|
|
12
|
+
/** Configuration for {@link createHttpTelemetrySink}. */
|
|
13
|
+
interface HttpTelemetrySinkOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Headers sent with every delivery, such as a public write-only ingestion key or a per-user
|
|
16
|
+
* credential acquired at runtime.
|
|
17
|
+
*
|
|
18
|
+
* A compiled distribution cannot keep an embedded secret. Additional headers are sent verbatim,
|
|
19
|
+
* the transport enforces `content-type: application/json`, and results and diagnostics never echo
|
|
20
|
+
* header values.
|
|
21
|
+
*/
|
|
22
|
+
readonly headers?: Readonly<Record<string, string>> | undefined;
|
|
23
|
+
/** Events per POST. Defaults to {@link DEFAULT_MAX_BATCH}; must be a positive safe integer. */
|
|
24
|
+
readonly maxBatch?: number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Events held before `record` starts dropping the newest.
|
|
27
|
+
*
|
|
28
|
+
* Defaults to {@link DEFAULT_MAX_BUFFERED_EVENTS} and must be a positive safe integer. A cap
|
|
29
|
+
* rather than an error: telemetry must never grow without bound or fail the run that produced it.
|
|
30
|
+
*/
|
|
31
|
+
readonly maxBufferedEvents?: number | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Receives delivery failures without event data, the endpoint URL, or headers.
|
|
34
|
+
*
|
|
35
|
+
* The callback is observational only: throws are swallowed and can never fail the CLI run.
|
|
36
|
+
*/
|
|
37
|
+
readonly onDeliveryFailure?: ((failure: HttpTelemetryDeliveryFailure) => void) | undefined;
|
|
38
|
+
/** Transport override for tests. Defaults to the kernel's bounded TLS-only client. */
|
|
39
|
+
readonly post?: ((request: HttpPostRequest) => Promise<HttpPostResult>) | undefined;
|
|
40
|
+
/** Positive finite milliseconds per POST. Defaults to {@link DEFAULT_POST_TIMEOUT_MS}. */
|
|
41
|
+
readonly timeoutMs?: number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Absolute `https:` endpoint URL without embedded credentials. Plain `http:` is refused except
|
|
44
|
+
* for literal loopback hosts. Invalid values throw when the sink is created.
|
|
45
|
+
*/
|
|
46
|
+
readonly url: string;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/report-types.d.ts
|
|
50
|
+
interface ReportAppDetection {
|
|
51
|
+
readonly authenticated?: boolean | undefined;
|
|
52
|
+
readonly installed: boolean;
|
|
53
|
+
readonly version?: string | undefined;
|
|
54
|
+
}
|
|
55
|
+
interface ReportApp {
|
|
56
|
+
readonly appId: string;
|
|
57
|
+
readonly detection: ReportAppDetection;
|
|
58
|
+
readonly detectionScope?: string | undefined;
|
|
59
|
+
readonly displayName: string;
|
|
60
|
+
readonly support?: AdapterSupport | undefined;
|
|
61
|
+
}
|
|
62
|
+
interface ReportFinding {
|
|
63
|
+
readonly checkId: string;
|
|
64
|
+
readonly details?: string | undefined;
|
|
65
|
+
readonly findingId: string;
|
|
66
|
+
readonly fixability: Fixability;
|
|
67
|
+
readonly locations?: readonly FindingLocation[] | undefined;
|
|
68
|
+
readonly message: string;
|
|
69
|
+
readonly metadata?: JsonObject | undefined;
|
|
70
|
+
readonly presentation?: FindingPresentation | undefined;
|
|
71
|
+
readonly scope: Scope;
|
|
72
|
+
readonly severity: Severity;
|
|
73
|
+
}
|
|
74
|
+
interface PassedCheck {
|
|
75
|
+
readonly id: string;
|
|
76
|
+
readonly title: string;
|
|
77
|
+
}
|
|
78
|
+
interface CheckCounts {
|
|
79
|
+
readonly errors: number;
|
|
80
|
+
readonly informational: number;
|
|
81
|
+
readonly passed: number;
|
|
82
|
+
readonly warnings: number;
|
|
83
|
+
}
|
|
84
|
+
interface CheckSummary extends CheckCounts {
|
|
85
|
+
readonly categories: Readonly<Record<string, CheckCounts>>;
|
|
86
|
+
readonly diagnostics: number;
|
|
87
|
+
readonly exitCode: CliExitCode;
|
|
88
|
+
}
|
|
89
|
+
interface ReportDiagnostic {
|
|
90
|
+
readonly detail?: string | undefined;
|
|
91
|
+
readonly id: string;
|
|
92
|
+
readonly message: string;
|
|
93
|
+
readonly path?: string | undefined;
|
|
94
|
+
readonly phase: "check" | "detect" | "files" | "fix" | "parse" | "read" | "support";
|
|
95
|
+
}
|
|
96
|
+
type ReportStatus = "clean" | "empty" | "error" | "operational-error" | "warning";
|
|
97
|
+
interface ReportFixOperation {
|
|
98
|
+
readonly conflict?: string | undefined;
|
|
99
|
+
readonly diff?: string | undefined;
|
|
100
|
+
readonly effect: "archive" | "conflict" | "create" | "move" | "noop" | "remove" | "symlink" | "update";
|
|
101
|
+
readonly paths: readonly string[];
|
|
102
|
+
}
|
|
103
|
+
interface ReportFix {
|
|
104
|
+
readonly checkId: string;
|
|
105
|
+
readonly findingId: string;
|
|
106
|
+
readonly manualSteps: readonly string[];
|
|
107
|
+
readonly message?: string | undefined;
|
|
108
|
+
readonly operations: readonly ReportFixOperation[];
|
|
109
|
+
readonly status: "applied" | "failed" | "partial" | "planned";
|
|
110
|
+
readonly summary: string;
|
|
111
|
+
}
|
|
112
|
+
interface CheckReportV1 {
|
|
113
|
+
readonly apps: readonly ReportApp[];
|
|
114
|
+
readonly diagnostics: readonly ReportDiagnostic[];
|
|
115
|
+
readonly findings: readonly ReportFinding[];
|
|
116
|
+
readonly fixes?: readonly ReportFix[] | undefined;
|
|
117
|
+
readonly kind: "check-report";
|
|
118
|
+
readonly passedChecks: readonly PassedCheck[];
|
|
119
|
+
readonly schemaVersion: 1;
|
|
120
|
+
readonly status: ReportStatus;
|
|
121
|
+
readonly summary: CheckSummary;
|
|
122
|
+
}
|
|
123
|
+
type CheckReport = CheckReportV1;
|
|
124
|
+
interface CheckExplanationV1 {
|
|
125
|
+
readonly enabled: boolean;
|
|
126
|
+
readonly explain: string;
|
|
127
|
+
readonly fixability: Fixability;
|
|
128
|
+
readonly fixesApplicable: boolean;
|
|
129
|
+
readonly id: string;
|
|
130
|
+
readonly kind: "check-explanation";
|
|
131
|
+
readonly schemaVersion: 1;
|
|
132
|
+
readonly scope: Scope;
|
|
133
|
+
readonly severity: Severity;
|
|
134
|
+
readonly provenance: {
|
|
135
|
+
readonly enabled: AuraConfigurationProvenance;
|
|
136
|
+
readonly severity: AuraConfigurationProvenance;
|
|
137
|
+
readonly thresholds: AuraConfigurationProvenance;
|
|
138
|
+
};
|
|
139
|
+
readonly preset?: {
|
|
140
|
+
readonly name: string;
|
|
141
|
+
readonly reference: string;
|
|
142
|
+
} | undefined;
|
|
143
|
+
readonly thresholds: JsonObject;
|
|
144
|
+
readonly title: string;
|
|
145
|
+
}
|
|
146
|
+
type CheckExplanation = CheckExplanationV1;
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/index.release.d.ts
|
|
149
|
+
declare function runCli(distro: CliDistro, runtime?: CliRuntime): Promise<CliExitCode>;
|
|
150
|
+
declare function createHttpTelemetrySink(options: HttpTelemetrySinkOptions): TelemetrySink$1;
|
|
151
|
+
//#endregion
|
|
152
|
+
export { type CheckCounts, type CheckExplanation, type CheckExplanationV1, type CheckReport, type CheckReportV1, type CheckSummary, type CliBranding, type CliDistro, type CliExitCode, type CliRegistryOptions, type CliRuntime, type HttpTelemetryDeliveryFailure, type HttpTelemetrySinkOptions, type PassedCheck, type ReportApp, type ReportDiagnostic, type ReportFinding, type ReportFix, type ReportFixOperation, type ReportStatus, type TelemetryEvent, type TelemetrySink, createHttpTelemetrySink, runCli };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { i as vetHttpUrl, n as clampHttpTimeout, r as failureReason, t as runCli } from "./run-pMPxJqFQ.js";
|
|
2
|
+
//#region ../core/src/http-post.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a bounded, TLS-only JSON POST that never rejects.
|
|
5
|
+
*
|
|
6
|
+
* The delivery-side sibling of {@link createHttpGet}, holding to the same discipline: plain
|
|
7
|
+
* `http:` is refused except for literal loopback hosts, redirects are refused (`redirect:
|
|
8
|
+
* "error"`) so headers are never re-sent to an address the caller did not name, and every throw
|
|
9
|
+
* collapses into the closed failure vocabulary with no request echo. The response body is
|
|
10
|
+
* discarded unread — a delivery needs only the status code.
|
|
11
|
+
*/
|
|
12
|
+
function createHttpPost() {
|
|
13
|
+
return async (request) => {
|
|
14
|
+
const vetted = vetHttpUrl(request.url);
|
|
15
|
+
if (!(vetted instanceof URL)) return {
|
|
16
|
+
kind: "failure",
|
|
17
|
+
reason: vetted
|
|
18
|
+
};
|
|
19
|
+
try {
|
|
20
|
+
const headers = new Headers(request.headers);
|
|
21
|
+
headers.set("content-type", "application/json");
|
|
22
|
+
const response = await fetch(vetted, {
|
|
23
|
+
body: request.body,
|
|
24
|
+
headers,
|
|
25
|
+
method: "POST",
|
|
26
|
+
redirect: "error",
|
|
27
|
+
signal: postSignal(request)
|
|
28
|
+
});
|
|
29
|
+
await response.body?.cancel();
|
|
30
|
+
return {
|
|
31
|
+
kind: "response",
|
|
32
|
+
status: response.status
|
|
33
|
+
};
|
|
34
|
+
} catch (error) {
|
|
35
|
+
return {
|
|
36
|
+
kind: "failure",
|
|
37
|
+
reason: failureReason(error)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Combines caller cancellation with the transport's non-negotiable timeout. */
|
|
43
|
+
function postSignal(request) {
|
|
44
|
+
const timeout = AbortSignal.timeout(clampHttpTimeout(request.timeoutMs));
|
|
45
|
+
return request.signal === void 0 ? timeout : AbortSignal.any([request.signal, timeout]);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/http-telemetry-sink.ts
|
|
49
|
+
/** Events per POST when {@link HttpTelemetrySinkOptions.maxBatch} is omitted. */
|
|
50
|
+
const DEFAULT_MAX_BATCH = 50;
|
|
51
|
+
/** Buffered-event cap when {@link HttpTelemetrySinkOptions.maxBufferedEvents} is omitted. */
|
|
52
|
+
const DEFAULT_MAX_BUFFERED_EVENTS = 1e3;
|
|
53
|
+
/** Per-POST timeout when {@link HttpTelemetrySinkOptions.timeoutMs} is omitted, sized to fit the CLI's flush budget. */
|
|
54
|
+
const DEFAULT_POST_TIMEOUT_MS = 2e3;
|
|
55
|
+
/**
|
|
56
|
+
* A {@link TelemetrySink} that batches events and delivers them as JSON over HTTPS.
|
|
57
|
+
*
|
|
58
|
+
* `record` only buffers; nothing leaves the machine until the CLI's end-of-run `flush`, which
|
|
59
|
+
* posts `{ events, kind: "aura-telemetry", schemaVersion: 1 }` in batches. Delivery is
|
|
60
|
+
* best-effort by design: a failed or non-2xx batch is dropped without retry — the process is
|
|
61
|
+
* exiting — and neither method ever throws or rejects. Configuration errors throw immediately;
|
|
62
|
+
* runtime delivery failures reach the optional privacy-safe observer.
|
|
63
|
+
*/
|
|
64
|
+
function createHttpTelemetrySink(options) {
|
|
65
|
+
validateUrl(options.url);
|
|
66
|
+
const post = options.post ?? createHttpPost();
|
|
67
|
+
const maxBatch = positiveInteger(options.maxBatch, DEFAULT_MAX_BATCH, "maxBatch");
|
|
68
|
+
const maxBufferedEvents = positiveInteger(options.maxBufferedEvents, DEFAULT_MAX_BUFFERED_EVENTS, "maxBufferedEvents");
|
|
69
|
+
const timeoutMs = positiveNumber(options.timeoutMs, DEFAULT_POST_TIMEOUT_MS, "timeoutMs");
|
|
70
|
+
const buffered = [];
|
|
71
|
+
return {
|
|
72
|
+
flush: async (signal) => {
|
|
73
|
+
const events = buffered.splice(0);
|
|
74
|
+
for (let start = 0; start < events.length; start += maxBatch) {
|
|
75
|
+
if (signal.aborted) break;
|
|
76
|
+
await deliver(post, {
|
|
77
|
+
body: JSON.stringify({
|
|
78
|
+
events: events.slice(start, start + maxBatch),
|
|
79
|
+
kind: "aura-telemetry",
|
|
80
|
+
schemaVersion: 1
|
|
81
|
+
}),
|
|
82
|
+
...options.headers === void 0 ? {} : { headers: options.headers },
|
|
83
|
+
signal,
|
|
84
|
+
timeoutMs,
|
|
85
|
+
url: options.url
|
|
86
|
+
}, options.onDeliveryFailure);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
record: (event) => {
|
|
90
|
+
if (buffered.length < maxBufferedEvents) buffered.push(event);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** Delivers one batch and reports only a closed, privacy-safe failure reason. */
|
|
95
|
+
async function deliver(post, request, onFailure) {
|
|
96
|
+
let result;
|
|
97
|
+
try {
|
|
98
|
+
result = await post(request);
|
|
99
|
+
} catch {
|
|
100
|
+
notifyFailure(onFailure, {
|
|
101
|
+
kind: "transport",
|
|
102
|
+
reason: "rejected"
|
|
103
|
+
});
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (result.kind === "failure") notifyFailure(onFailure, {
|
|
107
|
+
kind: "transport",
|
|
108
|
+
reason: result.reason
|
|
109
|
+
});
|
|
110
|
+
else if (result.status < 200 || result.status >= 300) notifyFailure(onFailure, {
|
|
111
|
+
kind: "http-status",
|
|
112
|
+
status: result.status
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/** A sink observer cannot affect the command it watches. */
|
|
116
|
+
function notifyFailure(observer, failure) {
|
|
117
|
+
try {
|
|
118
|
+
observer?.(failure);
|
|
119
|
+
} catch {}
|
|
120
|
+
}
|
|
121
|
+
/** Refuses a broken or credential-bearing endpoint when the distribution is composed. */
|
|
122
|
+
function validateUrl(raw) {
|
|
123
|
+
const vetted = vetHttpUrl(raw);
|
|
124
|
+
if (!(vetted instanceof URL)) throw new TypeError("Telemetry URL must be absolute and use https (plain http is loopback-only).");
|
|
125
|
+
if (vetted.username !== "" || vetted.password !== "") throw new TypeError("Telemetry URL must not contain embedded credentials.");
|
|
126
|
+
}
|
|
127
|
+
/** Supplies the default or refuses a non-positive, non-finite, or fractional count. */
|
|
128
|
+
function positiveInteger(value, fallback, name) {
|
|
129
|
+
if (value === void 0) return fallback;
|
|
130
|
+
if (!Number.isSafeInteger(value) || value <= 0) throw new RangeError(`${name} must be a positive safe integer.`);
|
|
131
|
+
return value;
|
|
132
|
+
}
|
|
133
|
+
/** Supplies the default or refuses a timeout that cannot bound work. */
|
|
134
|
+
function positiveNumber(value, fallback, name) {
|
|
135
|
+
if (value === void 0) return fallback;
|
|
136
|
+
if (!Number.isFinite(value) || value <= 0) throw new RangeError(`${name} must be a positive finite number.`);
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
export { createHttpTelemetrySink, runCli };
|