eas-cli 23.2.0 → 24.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/README.md +636 -331
- package/build/build/utils/url.d.ts +1 -0
- package/build/build/utils/url.js +4 -0
- package/build/channel/protection.d.ts +4 -0
- package/build/channel/protection.js +49 -0
- package/build/channel/queries.d.ts +6 -0
- package/build/channel/queries.js +5 -1
- package/build/commands/channel/protect.d.ts +16 -0
- package/build/commands/channel/protect.js +68 -0
- package/build/commands/channel/unprotect.d.ts +16 -0
- package/build/commands/channel/unprotect.js +78 -0
- package/build/commands/observe/errors.d.ts +27 -0
- package/build/commands/observe/errors.js +122 -0
- package/build/commands/observe/event.d.ts +18 -0
- package/build/commands/observe/event.js +149 -0
- package/build/commands/observe/events.d.ts +2 -0
- package/build/commands/observe/events.js +10 -4
- package/build/commands/observe/metrics-summary.d.ts +1 -0
- package/build/commands/observe/metrics-summary.js +3 -2
- package/build/commands/observe/metrics.d.ts +2 -0
- package/build/commands/observe/metrics.js +8 -4
- package/build/commands/observe/routes.d.ts +2 -1
- package/build/commands/observe/routes.js +5 -5
- package/build/commands/observe/session.d.ts +1 -0
- package/build/commands/observe/session.js +14 -8
- package/build/commands/observe/versions.d.ts +1 -0
- package/build/commands/observe/versions.js +3 -2
- package/build/commands/project/status.d.ts +16 -0
- package/build/commands/project/status.js +47 -0
- package/build/commands/simulator/egress.d.ts +13 -0
- package/build/commands/simulator/egress.js +60 -0
- package/build/commands/simulator/get.js +3 -1
- package/build/commands/simulator/index.d.ts +2 -0
- package/build/commands/simulator/index.js +81 -11
- package/build/credentials/ios/credentials.d.ts +5 -3
- package/build/credentials/ios/utils/printCredentials.js +6 -1
- package/build/graphql/generated.d.ts +2388 -1092
- package/build/graphql/generated.js +64 -17
- package/build/graphql/mutations/RealtimeLogsMutation.d.ts +2 -2
- package/build/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +1 -1
- package/build/graphql/queries/AppStoreConnectApiKeyQuery.js +1 -1
- package/build/graphql/queries/ChannelQuery.js +2 -0
- package/build/graphql/queries/DeviceRunSessionQuery.js +25 -0
- package/build/graphql/queries/ObserveQuery.d.ts +62 -30
- package/build/graphql/queries/ObserveQuery.js +276 -121
- package/build/graphql/queries/SubmissionQuery.d.ts +6 -1
- package/build/graphql/queries/SubmissionQuery.js +41 -0
- package/build/graphql/types/Observe.d.ts +5 -3
- package/build/graphql/types/Observe.js +80 -21
- package/build/graphql/types/UpdateChannelBasicInfo.js +1 -0
- package/build/observe/fetchCustomEvents.d.ts +6 -4
- package/build/observe/fetchCustomEvents.js +4 -2
- package/build/observe/fetchErrors.d.ts +32 -0
- package/build/observe/fetchErrors.js +42 -0
- package/build/observe/fetchEvents.d.ts +9 -6
- package/build/observe/fetchEvents.js +16 -17
- package/build/observe/fetchMetrics.d.ts +2 -2
- package/build/observe/fetchMetrics.js +9 -9
- package/build/observe/fetchNavigationRoutes.d.ts +7 -5
- package/build/observe/fetchNavigationRoutes.js +8 -8
- package/build/observe/fetchSessions.d.ts +13 -11
- package/build/observe/fetchSessions.js +59 -30
- package/build/observe/fetchVersions.d.ts +4 -3
- package/build/observe/fetchVersions.js +7 -11
- package/build/observe/flags.d.ts +6 -0
- package/build/observe/flags.js +12 -2
- package/build/observe/formatCustomEvents.d.ts +16 -10
- package/build/observe/formatCustomEvents.js +61 -28
- package/build/observe/formatErrors.d.ts +97 -0
- package/build/observe/formatErrors.js +203 -0
- package/build/observe/formatEvents.d.ts +11 -5
- package/build/observe/formatEvents.js +46 -18
- package/build/observe/formatMetrics.d.ts +4 -4
- package/build/observe/formatMetrics.js +2 -2
- package/build/observe/formatNavigationRoutes.d.ts +4 -4
- package/build/observe/formatNavigationRoutes.js +3 -3
- package/build/observe/formatSessions.d.ts +3 -3
- package/build/observe/formatSessions.js +8 -8
- package/build/observe/formatVersions.js +2 -2
- package/build/observe/platforms.d.ts +10 -19
- package/build/observe/platforms.js +42 -40
- package/build/project/projectStatus.d.ts +96 -0
- package/build/project/projectStatus.js +314 -0
- package/build/simulator/egress.d.ts +121 -0
- package/build/simulator/egress.js +865 -0
- package/build/simulator/env.d.ts +5 -0
- package/build/simulator/env.js +42 -1
- package/build/simulator/utils.d.ts +53 -2
- package/build/simulator/utils.js +158 -10
- package/build/submit/utils/urls.js +2 -3
- package/build/utils/centrifuge.d.ts +2 -2
- package/oclif.manifest.json +1162 -546
- package/package.json +7 -7
- package/build/chat/chatClient.d.ts +0 -37
- package/build/chat/chatClient.js +0 -359
- package/build/chat/detectProject.d.ts +0 -5
- package/build/chat/detectProject.js +0 -41
- package/build/chat/renderMarkdown.d.ts +0 -7
- package/build/chat/renderMarkdown.js +0 -47
- package/build/chat/replInput.d.ts +0 -10
- package/build/chat/replInput.js +0 -52
- package/build/commands/chat.d.ts +0 -18
- package/build/commands/chat.js +0 -221
package/build/commands/chat.js
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@oclif/core");
|
|
5
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
-
const chatClient_1 = require("../chat/chatClient");
|
|
7
|
-
const detectProject_1 = require("../chat/detectProject");
|
|
8
|
-
const replInput_1 = require("../chat/replInput");
|
|
9
|
-
const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
|
|
10
|
-
const flags_1 = require("../commandUtils/flags");
|
|
11
|
-
const AppQuery_1 = require("../graphql/queries/AppQuery");
|
|
12
|
-
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
13
|
-
const json_1 = require("../utils/json");
|
|
14
|
-
const EXIT_WORDS = new Set(['exit', 'quit', 'q']);
|
|
15
|
-
const USER_LABEL = `${chalk_1.default.bold.cyan('Chat')}${chalk_1.default.dim(' > ')}`;
|
|
16
|
-
const CHAT_HELP = [
|
|
17
|
-
'Commands:',
|
|
18
|
-
' /help Show this help',
|
|
19
|
-
' /clear Start a new conversation',
|
|
20
|
-
' /exit Quit',
|
|
21
|
-
].join('\n');
|
|
22
|
-
class Chat extends EasCommand_1.default {
|
|
23
|
-
static description = 'ask an AI assistant about your Expo account and EAS projects';
|
|
24
|
-
static hidden = true;
|
|
25
|
-
static args = {
|
|
26
|
-
message: core_1.Args.string({
|
|
27
|
-
required: false,
|
|
28
|
-
description: 'Message to send to the assistant (omit to open an interactive prompt)',
|
|
29
|
-
}),
|
|
30
|
-
};
|
|
31
|
-
static flags = {
|
|
32
|
-
account: core_1.Flags.string({
|
|
33
|
-
char: 'a',
|
|
34
|
-
description: 'Account to scope the conversation to (defaults to your primary account)',
|
|
35
|
-
}),
|
|
36
|
-
project: core_1.Flags.string({
|
|
37
|
-
char: 'p',
|
|
38
|
-
description: 'Project to focus the conversation on, as @account-name/project-slug or a project slug',
|
|
39
|
-
}),
|
|
40
|
-
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
41
|
-
};
|
|
42
|
-
static contextDefinition = {
|
|
43
|
-
...this.ContextOptions.LoggedIn,
|
|
44
|
-
};
|
|
45
|
-
async runAsync() {
|
|
46
|
-
const { args, flags } = await this.parse(Chat);
|
|
47
|
-
const { json, nonInteractive } = (0, flags_1.resolveNonInteractiveAndJsonFlags)(flags);
|
|
48
|
-
if (json) {
|
|
49
|
-
(0, json_1.enableJsonOutput)();
|
|
50
|
-
}
|
|
51
|
-
if (!args.message && (json || nonInteractive)) {
|
|
52
|
-
throw new Error('Provide a message, e.g. `eas chat "how are my builds?"`.');
|
|
53
|
-
}
|
|
54
|
-
const { loggedIn: { actor, authenticationInfo, graphqlClient }, } = await this.getContextAsync(Chat, { nonInteractive });
|
|
55
|
-
if (!authenticationInfo.sessionSecret) {
|
|
56
|
-
throw new Error('`eas chat` requires an interactive login. Run `eas login` first. Chat does not support EXPO_TOKEN access tokens yet.');
|
|
57
|
-
}
|
|
58
|
-
const { sessionSecret } = authenticationInfo;
|
|
59
|
-
let accountName = flags.account ?? getDefaultAccountName(actor);
|
|
60
|
-
let projectLabel;
|
|
61
|
-
let projectDetectedFromDirectory = false;
|
|
62
|
-
if (flags.project) {
|
|
63
|
-
const resolved = await resolveProjectAsync(graphqlClient, flags.project, accountName);
|
|
64
|
-
accountName = resolved.accountName;
|
|
65
|
-
projectLabel = resolved.label;
|
|
66
|
-
}
|
|
67
|
-
else if (!flags.account) {
|
|
68
|
-
const detected = await (0, detectProject_1.detectCurrentProjectAsync)(graphqlClient);
|
|
69
|
-
if (detected) {
|
|
70
|
-
accountName = detected.accountName;
|
|
71
|
-
projectLabel = detected.label;
|
|
72
|
-
projectDetectedFromDirectory = true;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (json) {
|
|
76
|
-
const messages = [
|
|
77
|
-
(0, chatClient_1.makeUserMessage)(scopeMessageToProject(args.message, projectLabel)),
|
|
78
|
-
];
|
|
79
|
-
const result = await (0, chatClient_1.streamChatResponseAsync)({
|
|
80
|
-
messages: [...messages],
|
|
81
|
-
accountName,
|
|
82
|
-
sessionSecret,
|
|
83
|
-
stream: false,
|
|
84
|
-
});
|
|
85
|
-
(0, json_1.printJsonOnlyOutput)({
|
|
86
|
-
message: args.message,
|
|
87
|
-
account: accountName ?? null,
|
|
88
|
-
project: projectLabel ?? null,
|
|
89
|
-
response: result.text,
|
|
90
|
-
toolCalls: result.toolCalls,
|
|
91
|
-
});
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (projectLabel) {
|
|
95
|
-
log_1.default.log(chalk_1.default.dim(projectDetectedFromDirectory
|
|
96
|
-
? `Project: ${projectLabel} (from current directory; use --account to widen)`
|
|
97
|
-
: `Project: ${projectLabel}`));
|
|
98
|
-
}
|
|
99
|
-
if (!nonInteractive) {
|
|
100
|
-
log_1.default.log(chalk_1.default.dim('Use /help for commands, or /exit to quit.'));
|
|
101
|
-
}
|
|
102
|
-
const input = nonInteractive
|
|
103
|
-
? undefined
|
|
104
|
-
: (0, replInput_1.createChatReplInput)({ history: args.message ? [args.message] : [] });
|
|
105
|
-
const messages = [];
|
|
106
|
-
if (args.message) {
|
|
107
|
-
log_1.default.log(`${USER_LABEL}${args.message}`);
|
|
108
|
-
log_1.default.newLine();
|
|
109
|
-
messages.push((0, chatClient_1.makeUserMessage)(scopeMessageToProject(args.message, projectLabel)));
|
|
110
|
-
}
|
|
111
|
-
try {
|
|
112
|
-
for (;;) {
|
|
113
|
-
const lastMessage = messages[messages.length - 1];
|
|
114
|
-
if (!lastMessage || lastMessage.role === 'assistant') {
|
|
115
|
-
if (!input) {
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
const scopeNextMessage = messages.length === 0;
|
|
119
|
-
const nextMessage = await readNextUserMessageAsync(input, messages, projectLabel, scopeNextMessage);
|
|
120
|
-
if (nextMessage === null) {
|
|
121
|
-
log_1.default.log(chalk_1.default.dim('Ending chat.'));
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
messages.push((0, chatClient_1.makeUserMessage)(nextMessage));
|
|
125
|
-
}
|
|
126
|
-
let result;
|
|
127
|
-
try {
|
|
128
|
-
result = await (0, chatClient_1.streamChatResponseAsync)({
|
|
129
|
-
messages: [...messages],
|
|
130
|
-
accountName,
|
|
131
|
-
sessionSecret,
|
|
132
|
-
stream: true,
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
if (!input) {
|
|
137
|
-
throw error;
|
|
138
|
-
}
|
|
139
|
-
log_1.default.error(error instanceof Error ? error.message : String(error));
|
|
140
|
-
messages.pop();
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
messages.push(result.assistantMessage);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
finally {
|
|
147
|
-
input?.close();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
exports.default = Chat;
|
|
152
|
-
async function readNextUserMessageAsync(input, messages, projectLabel, scopeFirstMessage = false) {
|
|
153
|
-
let shouldRestoreProjectScope = scopeFirstMessage;
|
|
154
|
-
for (;;) {
|
|
155
|
-
log_1.default.newLine();
|
|
156
|
-
const line = await input.askAsync(USER_LABEL);
|
|
157
|
-
if (line === null) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
const trimmed = line.trim();
|
|
161
|
-
if (!trimmed) {
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
if (EXIT_WORDS.has(trimmed.toLowerCase())) {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
if (trimmed.startsWith('/')) {
|
|
168
|
-
const command = trimmed.slice(1).split(/\s+/)[0].toLowerCase();
|
|
169
|
-
if (['exit', 'quit', 'q'].includes(command)) {
|
|
170
|
-
return null;
|
|
171
|
-
}
|
|
172
|
-
if (['clear', 'new', 'reset'].includes(command)) {
|
|
173
|
-
messages.length = 0;
|
|
174
|
-
shouldRestoreProjectScope = true;
|
|
175
|
-
log_1.default.log(chalk_1.default.dim('Started a new conversation.'));
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (['help', 'h', '?'].includes(command)) {
|
|
179
|
-
log_1.default.log(chalk_1.default.dim(CHAT_HELP));
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
log_1.default.warn(`Unknown command "/${command}". Type /help for commands.`);
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
log_1.default.newLine();
|
|
186
|
-
return shouldRestoreProjectScope ? scopeMessageToProject(trimmed, projectLabel) : trimmed;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function scopeMessageToProject(message, projectLabel) {
|
|
190
|
-
return projectLabel ? `Regarding the EAS project ${projectLabel}: ${message}` : message;
|
|
191
|
-
}
|
|
192
|
-
function getDefaultAccountName(actor) {
|
|
193
|
-
if ('primaryAccount' in actor && actor.primaryAccount) {
|
|
194
|
-
return actor.primaryAccount.name;
|
|
195
|
-
}
|
|
196
|
-
return actor.accounts[0]?.name ?? undefined;
|
|
197
|
-
}
|
|
198
|
-
async function resolveProjectAsync(graphqlClient, projectReference, fallbackAccountName) {
|
|
199
|
-
const parsed = parseProjectReference(projectReference);
|
|
200
|
-
const accountForLookup = parsed.account ?? fallbackAccountName;
|
|
201
|
-
if (!accountForLookup) {
|
|
202
|
-
throw new Error(`Could not determine which account owns project "${projectReference}". Pass it as @account-name/project-slug.`);
|
|
203
|
-
}
|
|
204
|
-
const fullName = `@${accountForLookup}/${parsed.slug}`;
|
|
205
|
-
let app;
|
|
206
|
-
try {
|
|
207
|
-
app = await AppQuery_1.AppQuery.byFullNameAsync(graphqlClient, fullName);
|
|
208
|
-
}
|
|
209
|
-
catch {
|
|
210
|
-
throw new Error(`Project ${fullName} was not found or you do not have access to it.`);
|
|
211
|
-
}
|
|
212
|
-
return { accountName: app.ownerAccount.name, label: app.fullName };
|
|
213
|
-
}
|
|
214
|
-
function parseProjectReference(reference) {
|
|
215
|
-
const cleaned = reference.startsWith('@') ? reference.slice(1) : reference;
|
|
216
|
-
const parts = cleaned.split('/');
|
|
217
|
-
if (parts.length === 2 && parts[0] && parts[1]) {
|
|
218
|
-
return { account: parts[0], slug: parts[1] };
|
|
219
|
-
}
|
|
220
|
-
return { slug: cleaned };
|
|
221
|
-
}
|