@keystrokehq/cli 0.0.151 → 0.0.153
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/dist/{dist-BfTr7Wh6.mjs → dist-DqwV88tz.mjs} +74 -11
- package/dist/dist-DqwV88tz.mjs.map +1 -0
- package/dist/{dist-BgjNryKC.mjs → dist-Dtg0FGNT.mjs} +2 -2
- package/dist/{dist-BgjNryKC.mjs.map → dist-Dtg0FGNT.mjs.map} +1 -1
- package/dist/{dist-U4Rt-pcc.mjs → dist-SAPlw0EN.mjs} +2 -2
- package/dist/{dist-U4Rt-pcc.mjs.map → dist-SAPlw0EN.mjs.map} +1 -1
- package/dist/index.mjs +120 -289
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/dist-BfTr7Wh6.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as OrganizationSidebarBrandingPatchSchema, A as ErrorResponseSchema, At as UpdateCredentialRequestSchema, B as InviteProjectMembersRequestSchema, Bt as UpsertGatewayAttachmentBodySchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionResultSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerRunListResponseSchema, E as CreateProjectResponseSchema, Et as TriggerRunDetailResponseSchema, F as HistoryRunDetailResponseSchema, Ft as UpdateProjectMemberResponseSchema, G as ListOrganizationInvitationsResponseSchema, Gt as WorkflowRunDetailResponseSchema, H as ListApiKeysResponseSchema, Ht as UserAvatarSchema, I as HistoryRunListQuerySchema, It as UpdateProjectRequestSchema, J as ListProjectDeploymentsResponseSchema, Jt as WorkflowSummaryListResponseSchema, K as ListOrganizationMembersResponseSchema, Kt as WorkflowRunListResponseSchema, L as HistoryRunListResponseSchema, Lt as UpdateProjectSettingsRequestSchema, M as GetCredentialResponseSchema, Mt as UpdateOrganizationMemberResponseSchema, N as HealthResponseSchema, Nt as UpdateOrganizationRequestSchema, O as CredentialInstanceRecordSchema, Ot as UpdateChannelBindingBodySchema, P as HistoryRunCancelResponseSchema, Pt as UpdateProjectMemberRequestSchema, Q as ListProjectsResponseSchema, Qt as parseErrorResponse, R as InviteOrganizationMembersRequestSchema, Rt as UploadProjectSourceManifestRequestSchema, S as CreateOrganizationRequestSchema, St as StartOAuthConnectionInputSchema, T as CreateProjectRequestSchema, Tt as TriggerListResponseSchema, U as ListAppsResponseSchema, Ut as UserPreferencesPatchSchema, V as InviteProjectMembersResponseSchema, Vt as UserAvatarPatchSchema, W as ListCredentialsResponseSchema, Wt as UserPreferencesSchema, X as ListProjectMembersResponseSchema, Y as ListProjectFilesResponseSchema, Yt as listenPortFromPublicUrl, Z as ListProjectMetricsResponseSchema, Zt as originFromPublicUrl, _ as CreateApiKeyRequestSchema, _t as ROUTE_MANIFEST_REL_PATH, a as AgentSessionListResponseSchema, at as PresignProjectSourceRequestSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryListResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarResponseSchema, d as ChannelConnectionSchema, dt as ProjectSettingsResponseSchema, et as OrganizationSidebarBrandingSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSlugAvailabilityResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedRunResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as QueuedAgentPromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoResponseSchema, j as GatewayAttachmentRecordSchema, jt as UpdateOrganizationMemberRequestSchema, k as DeclineOrganizationInvitationResponseSchema, kt as UpdateCredentialInstanceBodySchema, l as ChannelAccountListResponseSchema, lt as ProjectReachabilityResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PollRunResponseSchema, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceResponseSchema, p as ChannelPlatformSchema, pt as PromptInputSchema, q as ListOrganizationsResponseSchema, qt as WorkflowSummaryDetailResponseSchema, r as ActiveOrganizationResponseSchema, rt as PresignOrgLogoRequestSchema, s as AgentSummaryListResponseSchema, st as PresignUserAvatarRequestSchema, t as ACTIVE_ORG_HEADER, tt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, u as ChannelConnectionListResponseSchema, ut as ProjectResponseSchema, v as CreateApiKeyResponseSchema, vt as RecentResourceListResponseSchema, w as CreateProjectArtifactResponseSchema, wt as TriggerDetailResponseSchema, x as CreateCredentialsResponseSchema, xt as SlugAvailabilityResponseSchema, y as CreateCredentialInstanceBodySchema, yt as SkillSummaryDetailResponseSchema, z as InviteOrganizationMembersResponseSchema, zt as UploadProjectSourceResponseSchema } from "./dist-DqwV88tz.mjs";
|
|
3
3
|
import { t as walkProject } from "./walk-project-171B4cvO-DJy3qZKd.mjs";
|
|
4
4
|
import { a as installPlaygroundDependencies, i as installDependencies, n as buildPlaygroundWorkspace, o as resolvePackageManager, s as resolveCliRoot, t as readCliVersion } from "./version-DESgLEkE.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -3760,125 +3760,6 @@ function createRecentsResource(http) {
|
|
|
3760
3760
|
}
|
|
3761
3761
|
} };
|
|
3762
3762
|
}
|
|
3763
|
-
const registry = /* @__PURE__ */ new Map();
|
|
3764
|
-
/**
|
|
3765
|
-
* Wraps a mock implementation, registering it in the manifest. The returned
|
|
3766
|
-
* function is the unchanged implementation — `mock()` only adds bookkeeping.
|
|
3767
|
-
*/
|
|
3768
|
-
function mock(entry, impl) {
|
|
3769
|
-
registry.set(`${entry.domain}.${entry.method}`, entry);
|
|
3770
|
-
return impl;
|
|
3771
|
-
}
|
|
3772
|
-
const DEFAULT_PROJECT_SETTINGS = {
|
|
3773
|
-
description: "",
|
|
3774
|
-
defaultRole: "editor",
|
|
3775
|
-
invitePermission: "admin"
|
|
3776
|
-
};
|
|
3777
|
-
const MOCK_STORAGE_KEY = "keystroke:mock-project-settings:v1";
|
|
3778
|
-
function getBrowserLocalStorage() {
|
|
3779
|
-
if (typeof globalThis !== "object") return null;
|
|
3780
|
-
return globalThis.localStorage ?? null;
|
|
3781
|
-
}
|
|
3782
|
-
function normalizeDefaultRole(value) {
|
|
3783
|
-
return value === "admin" ? "admin" : "editor";
|
|
3784
|
-
}
|
|
3785
|
-
function normalizeInvitePermission(value) {
|
|
3786
|
-
return value === "all" ? "all" : "admin";
|
|
3787
|
-
}
|
|
3788
|
-
function normalizeProjectSettings(value) {
|
|
3789
|
-
if (!value || typeof value !== "object") return DEFAULT_PROJECT_SETTINGS;
|
|
3790
|
-
const settings = value;
|
|
3791
|
-
return {
|
|
3792
|
-
description: typeof settings.description === "string" ? settings.description : "",
|
|
3793
|
-
defaultRole: normalizeDefaultRole(settings.defaultRole),
|
|
3794
|
-
invitePermission: normalizeInvitePermission(settings.invitePermission)
|
|
3795
|
-
};
|
|
3796
|
-
}
|
|
3797
|
-
function mergeProjectSettings(current, patch) {
|
|
3798
|
-
return normalizeProjectSettings({
|
|
3799
|
-
...current,
|
|
3800
|
-
...patch
|
|
3801
|
-
});
|
|
3802
|
-
}
|
|
3803
|
-
function readSettingsStore() {
|
|
3804
|
-
const localStorage = getBrowserLocalStorage();
|
|
3805
|
-
if (!localStorage) return {};
|
|
3806
|
-
try {
|
|
3807
|
-
const raw = localStorage.getItem(MOCK_STORAGE_KEY);
|
|
3808
|
-
if (!raw) return {};
|
|
3809
|
-
const parsed = JSON.parse(raw);
|
|
3810
|
-
if (!parsed || typeof parsed !== "object") return {};
|
|
3811
|
-
return Object.fromEntries(Object.entries(parsed).map(([projectId, value]) => [projectId, normalizeProjectSettings(value)]));
|
|
3812
|
-
} catch {
|
|
3813
|
-
return {};
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
function writeSettingsStore(store) {
|
|
3817
|
-
const localStorage = getBrowserLocalStorage();
|
|
3818
|
-
if (!localStorage) return;
|
|
3819
|
-
try {
|
|
3820
|
-
localStorage.setItem(MOCK_STORAGE_KEY, JSON.stringify(store));
|
|
3821
|
-
} catch {}
|
|
3822
|
-
}
|
|
3823
|
-
function requireProjectId(projectId) {
|
|
3824
|
-
const trimmed = projectId.trim();
|
|
3825
|
-
if (!trimmed) throw new Error("Project settings require a project id");
|
|
3826
|
-
return trimmed;
|
|
3827
|
-
}
|
|
3828
|
-
function createProjectSettingsResource() {
|
|
3829
|
-
return {
|
|
3830
|
-
get: mock({
|
|
3831
|
-
domain: "projectSettings",
|
|
3832
|
-
method: "get",
|
|
3833
|
-
plannedEndpoint: "GET /api/projects/:id/settings"
|
|
3834
|
-
}, async (projectId) => {
|
|
3835
|
-
const id = requireProjectId(projectId);
|
|
3836
|
-
return readSettingsStore()[id] ?? DEFAULT_PROJECT_SETTINGS;
|
|
3837
|
-
}),
|
|
3838
|
-
update: mock({
|
|
3839
|
-
domain: "projectSettings",
|
|
3840
|
-
method: "update",
|
|
3841
|
-
plannedEndpoint: "PATCH /api/projects/:id/settings"
|
|
3842
|
-
}, async (projectId, patch) => {
|
|
3843
|
-
const id = requireProjectId(projectId);
|
|
3844
|
-
const store = readSettingsStore();
|
|
3845
|
-
const next = mergeProjectSettings(store[id] ?? DEFAULT_PROJECT_SETTINGS, patch);
|
|
3846
|
-
writeSettingsStore({
|
|
3847
|
-
...store,
|
|
3848
|
-
[id]: next
|
|
3849
|
-
});
|
|
3850
|
-
return next;
|
|
3851
|
-
})
|
|
3852
|
-
};
|
|
3853
|
-
}
|
|
3854
|
-
function createInvitationsResource(http) {
|
|
3855
|
-
return {
|
|
3856
|
-
async list() {
|
|
3857
|
-
try {
|
|
3858
|
-
const data = await http.get("/api/invitations").json();
|
|
3859
|
-
return ListOrganizationInvitationsResponseSchema.parse(data).invitations;
|
|
3860
|
-
} catch (error) {
|
|
3861
|
-
throw await toPlatformError(error);
|
|
3862
|
-
}
|
|
3863
|
-
},
|
|
3864
|
-
async accept(invitationId) {
|
|
3865
|
-
try {
|
|
3866
|
-
const data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/accept`).json();
|
|
3867
|
-
return AcceptOrganizationInvitationResponseSchema.parse(data).organization;
|
|
3868
|
-
} catch (error) {
|
|
3869
|
-
throw await toPlatformError(error);
|
|
3870
|
-
}
|
|
3871
|
-
},
|
|
3872
|
-
async decline(invitationId) {
|
|
3873
|
-
try {
|
|
3874
|
-
const data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/decline`).json();
|
|
3875
|
-
DeclineOrganizationInvitationResponseSchema.parse(data);
|
|
3876
|
-
} catch (error) {
|
|
3877
|
-
throw await toPlatformError(error);
|
|
3878
|
-
}
|
|
3879
|
-
}
|
|
3880
|
-
};
|
|
3881
|
-
}
|
|
3882
3763
|
function buildOAuthAuthorizeSearchParams(input) {
|
|
3883
3764
|
const params = {};
|
|
3884
3765
|
const scopes = input.scopes ?? [];
|
|
@@ -3957,7 +3838,7 @@ function createAppsResource(http) {
|
|
|
3957
3838
|
}
|
|
3958
3839
|
} };
|
|
3959
3840
|
}
|
|
3960
|
-
function createMembersResource
|
|
3841
|
+
function createMembersResource(http) {
|
|
3961
3842
|
return {
|
|
3962
3843
|
async listOrganizationMembers() {
|
|
3963
3844
|
try {
|
|
@@ -3991,177 +3872,127 @@ function createMembersResource$1(http) {
|
|
|
3991
3872
|
} catch (error) {
|
|
3992
3873
|
throw await toPlatformError(error);
|
|
3993
3874
|
}
|
|
3875
|
+
},
|
|
3876
|
+
async listForProject(projectId) {
|
|
3877
|
+
try {
|
|
3878
|
+
const data = await http.get(`/api/projects/${encodeURIComponent(projectId)}/members`).json();
|
|
3879
|
+
return ListProjectMembersResponseSchema.parse(data).members;
|
|
3880
|
+
} catch (error) {
|
|
3881
|
+
throw await toPlatformError(error);
|
|
3882
|
+
}
|
|
3883
|
+
},
|
|
3884
|
+
async inviteToProject(input) {
|
|
3885
|
+
const body = InviteProjectMembersRequestSchema.parse({
|
|
3886
|
+
emails: input.emails,
|
|
3887
|
+
role: input.role
|
|
3888
|
+
});
|
|
3889
|
+
try {
|
|
3890
|
+
const data = await http.post(`/api/projects/${encodeURIComponent(input.projectId)}/members`, { json: body }).json();
|
|
3891
|
+
return InviteProjectMembersResponseSchema.parse(data);
|
|
3892
|
+
} catch (error) {
|
|
3893
|
+
throw await toPlatformError(error);
|
|
3894
|
+
}
|
|
3895
|
+
},
|
|
3896
|
+
async updateProjectMember(projectId, userId, input) {
|
|
3897
|
+
const body = UpdateProjectMemberRequestSchema.parse(input);
|
|
3898
|
+
try {
|
|
3899
|
+
const data = await http.patch(`/api/projects/${encodeURIComponent(projectId)}/members/${encodeURIComponent(userId)}`, { json: body }).json();
|
|
3900
|
+
return UpdateProjectMemberResponseSchema.parse(data).member;
|
|
3901
|
+
} catch (error) {
|
|
3902
|
+
throw await toPlatformError(error);
|
|
3903
|
+
}
|
|
3904
|
+
},
|
|
3905
|
+
async removeProjectMember(projectId, userId) {
|
|
3906
|
+
try {
|
|
3907
|
+
await http.delete(`/api/projects/${encodeURIComponent(projectId)}/members/${encodeURIComponent(userId)}`);
|
|
3908
|
+
} catch (error) {
|
|
3909
|
+
throw await toPlatformError(error);
|
|
3910
|
+
}
|
|
3911
|
+
},
|
|
3912
|
+
async leaveProject(projectId) {
|
|
3913
|
+
try {
|
|
3914
|
+
await http.delete(`/api/projects/${encodeURIComponent(projectId)}/members/me`);
|
|
3915
|
+
} catch (error) {
|
|
3916
|
+
throw await toPlatformError(error);
|
|
3917
|
+
}
|
|
3994
3918
|
}
|
|
3995
3919
|
};
|
|
3996
3920
|
}
|
|
3997
|
-
|
|
3998
|
-
const mockPersonaSeed = [
|
|
3999
|
-
{
|
|
4000
|
-
id: "user_blake_rouse",
|
|
4001
|
-
name: "Blake Rouse",
|
|
4002
|
-
email: "blake@keystroke.ai",
|
|
4003
|
-
avatarUrl: "/icons/avatars/blake-rouse.png",
|
|
4004
|
-
joinedAt: "2026-01-12T18:00:00Z",
|
|
4005
|
-
lastActiveAt: "2026-05-31T18:00:00Z"
|
|
4006
|
-
},
|
|
4007
|
-
{
|
|
4008
|
-
id: "org-member-nate",
|
|
4009
|
-
name: "Nate Wells",
|
|
4010
|
-
email: "nate@keystroke.ai",
|
|
4011
|
-
avatarUrl: "/icons/avatars/nate-kelley.png",
|
|
4012
|
-
joinedAt: "2026-02-03T18:00:00Z",
|
|
4013
|
-
lastActiveAt: "2026-05-31T16:00:00Z"
|
|
4014
|
-
},
|
|
4015
|
-
{
|
|
4016
|
-
id: "org-member-dallin",
|
|
4017
|
-
name: "Dallin Bentley",
|
|
4018
|
-
email: "dallin@keystroke.ai",
|
|
4019
|
-
avatarUrl: "/icons/avatars/dallin-bentley.png",
|
|
4020
|
-
joinedAt: "2026-03-18T18:00:00Z",
|
|
4021
|
-
lastActiveAt: "2026-05-30T16:00:00Z"
|
|
4022
|
-
},
|
|
4023
|
-
{
|
|
4024
|
-
id: "org-member-wells",
|
|
4025
|
-
name: "Wells Riley",
|
|
4026
|
-
email: "wells@keystroke.ai",
|
|
4027
|
-
avatarUrl: "/icons/avatars/wells-bunker.png",
|
|
4028
|
-
joinedAt: "2026-04-09T18:00:00Z",
|
|
4029
|
-
lastActiveAt: "2026-05-20T16:00:00Z"
|
|
4030
|
-
}
|
|
4031
|
-
];
|
|
4032
|
-
const projectMemberSeed = mockPersonaSeed.map((member, index) => ({
|
|
4033
|
-
id: `project-member-${member.id}`,
|
|
4034
|
-
projectId: "project_personal_repo",
|
|
4035
|
-
name: member.name,
|
|
4036
|
-
email: member.email,
|
|
4037
|
-
role: index <= 1 ? "admin" : "editor",
|
|
4038
|
-
status: "active",
|
|
4039
|
-
avatarUrl: member.avatarUrl,
|
|
4040
|
-
joinedAt: member.joinedAt,
|
|
4041
|
-
lastActiveAt: member.lastActiveAt,
|
|
4042
|
-
isCurrentUser: member.id === "user_blake_rouse"
|
|
4043
|
-
}));
|
|
4044
|
-
const apiKeySeed = [
|
|
4045
|
-
{
|
|
4046
|
-
id: "api-key-local-dev",
|
|
4047
|
-
name: "LOCAL_DEV_BLAKE",
|
|
4048
|
-
keyPreview: "******J7Pt",
|
|
4049
|
-
createdAt: "2026-04-20T15:44:00Z",
|
|
4050
|
-
createdBy: mockPersonaSeed[0],
|
|
4051
|
-
isCreatedByCurrentUser: true
|
|
4052
|
-
},
|
|
4053
|
-
{
|
|
4054
|
-
id: "api-key-ci-deploy",
|
|
4055
|
-
name: "CI deploy",
|
|
4056
|
-
keyPreview: "******TJb7",
|
|
4057
|
-
createdAt: "2026-03-08T15:44:00Z",
|
|
4058
|
-
createdBy: mockPersonaSeed[1],
|
|
4059
|
-
isCreatedByCurrentUser: false
|
|
4060
|
-
},
|
|
4061
|
-
{
|
|
4062
|
-
id: "api-key-partner-webhooks",
|
|
4063
|
-
name: "partner_webhooks",
|
|
4064
|
-
keyPreview: "******9Qzc",
|
|
4065
|
-
createdAt: "2026-02-18T15:44:00Z",
|
|
4066
|
-
createdBy: mockPersonaSeed[2],
|
|
4067
|
-
isCreatedByCurrentUser: false
|
|
4068
|
-
}
|
|
4069
|
-
];
|
|
4070
|
-
function createMockApiKeySecret() {
|
|
4071
|
-
const secret = `sk_${`${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`}`;
|
|
3921
|
+
function createProjectSettingsResource(http) {
|
|
4072
3922
|
return {
|
|
4073
|
-
|
|
4074
|
-
|
|
3923
|
+
async get(projectId) {
|
|
3924
|
+
try {
|
|
3925
|
+
const data = await http.get(`/api/projects/${encodeURIComponent(projectId)}/settings`).json();
|
|
3926
|
+
return ProjectSettingsResponseSchema.parse(data).settings;
|
|
3927
|
+
} catch (error) {
|
|
3928
|
+
throw await toPlatformError(error);
|
|
3929
|
+
}
|
|
3930
|
+
},
|
|
3931
|
+
async update(projectId, patch) {
|
|
3932
|
+
const body = UpdateProjectSettingsRequestSchema.parse(patch);
|
|
3933
|
+
try {
|
|
3934
|
+
const data = await http.patch(`/api/projects/${encodeURIComponent(projectId)}/settings`, { json: body }).json();
|
|
3935
|
+
return ProjectSettingsResponseSchema.parse(data).settings;
|
|
3936
|
+
} catch (error) {
|
|
3937
|
+
throw await toPlatformError(error);
|
|
3938
|
+
}
|
|
3939
|
+
}
|
|
4075
3940
|
};
|
|
4076
3941
|
}
|
|
4077
|
-
|
|
4078
|
-
function getProjectMembers(projectId) {
|
|
4079
|
-
let members = projectMembersStore.get(projectId);
|
|
4080
|
-
if (!members) {
|
|
4081
|
-
members = projectMemberSeed.map((member) => ({
|
|
4082
|
-
...member,
|
|
4083
|
-
projectId
|
|
4084
|
-
}));
|
|
4085
|
-
projectMembersStore.set(projectId, members);
|
|
4086
|
-
}
|
|
4087
|
-
return members;
|
|
4088
|
-
}
|
|
4089
|
-
/** Derive a best-effort display name from an email local part. */
|
|
4090
|
-
function displayNameFromEmail(email) {
|
|
4091
|
-
return (email.split("@")[0] ?? email).split(/[._-]+/).filter((part) => part.length > 0).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
4092
|
-
}
|
|
4093
|
-
function createMembersResource(http) {
|
|
3942
|
+
function createInvitationsResource(http) {
|
|
4094
3943
|
return {
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
role: input.role,
|
|
4120
|
-
status: pendingOrgEmails.has(key) ? "invited" : "active",
|
|
4121
|
-
joinedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4122
|
-
lastActiveAt: null
|
|
4123
|
-
});
|
|
4124
|
-
});
|
|
4125
|
-
if (invited.length > 0) projectMembersStore.set(input.projectId, [...members, ...invited]);
|
|
4126
|
-
return { invited };
|
|
4127
|
-
})
|
|
3944
|
+
async list() {
|
|
3945
|
+
try {
|
|
3946
|
+
const data = await http.get("/api/invitations").json();
|
|
3947
|
+
return ListOrganizationInvitationsResponseSchema.parse(data).invitations;
|
|
3948
|
+
} catch (error) {
|
|
3949
|
+
throw await toPlatformError(error);
|
|
3950
|
+
}
|
|
3951
|
+
},
|
|
3952
|
+
async accept(invitationId) {
|
|
3953
|
+
try {
|
|
3954
|
+
const data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/accept`).json();
|
|
3955
|
+
return AcceptOrganizationInvitationResponseSchema.parse(data).organization;
|
|
3956
|
+
} catch (error) {
|
|
3957
|
+
throw await toPlatformError(error);
|
|
3958
|
+
}
|
|
3959
|
+
},
|
|
3960
|
+
async decline(invitationId) {
|
|
3961
|
+
try {
|
|
3962
|
+
const data = await http.post(`/api/invitations/${encodeURIComponent(invitationId)}/decline`).json();
|
|
3963
|
+
DeclineOrganizationInvitationResponseSchema.parse(data);
|
|
3964
|
+
} catch (error) {
|
|
3965
|
+
throw await toPlatformError(error);
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
4128
3968
|
};
|
|
4129
3969
|
}
|
|
4130
|
-
|
|
4131
|
-
function createApiKeysResource() {
|
|
3970
|
+
function createApiKeysResource(http) {
|
|
4132
3971
|
return {
|
|
4133
|
-
list
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
}),
|
|
4158
|
-
revoke: mock({
|
|
4159
|
-
domain: "apiKeys",
|
|
4160
|
-
method: "revoke",
|
|
4161
|
-
plannedEndpoint: "DELETE /api/api-keys/:id"
|
|
4162
|
-
}, async (apiKeyId) => {
|
|
4163
|
-
apiKeyRecords = apiKeyRecords.filter((apiKey) => apiKey.id !== apiKeyId);
|
|
4164
|
-
})
|
|
3972
|
+
async list() {
|
|
3973
|
+
try {
|
|
3974
|
+
const data = await http.get("/api/api-keys").json();
|
|
3975
|
+
return ListApiKeysResponseSchema.parse(data).apiKeys;
|
|
3976
|
+
} catch (error) {
|
|
3977
|
+
throw await toPlatformError(error);
|
|
3978
|
+
}
|
|
3979
|
+
},
|
|
3980
|
+
async create(input) {
|
|
3981
|
+
const body = CreateApiKeyRequestSchema.parse(input);
|
|
3982
|
+
try {
|
|
3983
|
+
const data = await http.post("/api/api-keys", { json: body }).json();
|
|
3984
|
+
return CreateApiKeyResponseSchema.parse(data);
|
|
3985
|
+
} catch (error) {
|
|
3986
|
+
throw await toPlatformError(error);
|
|
3987
|
+
}
|
|
3988
|
+
},
|
|
3989
|
+
async revoke(apiKeyId) {
|
|
3990
|
+
try {
|
|
3991
|
+
await http.delete(`/api/api-keys/${encodeURIComponent(apiKeyId)}`);
|
|
3992
|
+
} catch (error) {
|
|
3993
|
+
throw await toPlatformError(error);
|
|
3994
|
+
}
|
|
3995
|
+
}
|
|
4165
3996
|
};
|
|
4166
3997
|
}
|
|
4167
3998
|
function createHistoryResource(http) {
|
|
@@ -4460,7 +4291,7 @@ function createPlatformClient(options) {
|
|
|
4460
4291
|
}),
|
|
4461
4292
|
projects: createProjectsResource(http),
|
|
4462
4293
|
artifacts: createArtifactsResource(http),
|
|
4463
|
-
projectSettings: createProjectSettingsResource(),
|
|
4294
|
+
projectSettings: createProjectSettingsResource(http),
|
|
4464
4295
|
agents: createAgentsResource(http),
|
|
4465
4296
|
workflows: createWorkflowsResource(http),
|
|
4466
4297
|
skills: createSkillsResource(http),
|
|
@@ -4474,7 +4305,7 @@ function createPlatformClient(options) {
|
|
|
4474
4305
|
channels: createChannelsResource(http),
|
|
4475
4306
|
members: createMembersResource(http),
|
|
4476
4307
|
invitations: createInvitationsResource(http),
|
|
4477
|
-
apiKeys: createApiKeysResource(),
|
|
4308
|
+
apiKeys: createApiKeysResource(http),
|
|
4478
4309
|
recents: createRecentsResource(http),
|
|
4479
4310
|
userPreferences: createUserPreferencesResource(http),
|
|
4480
4311
|
userAvatar: createUserAvatarResource(http),
|
|
@@ -5620,7 +5451,7 @@ function registerBuildCommand(program) {
|
|
|
5620
5451
|
program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
|
|
5621
5452
|
try {
|
|
5622
5453
|
const root = resolveProjectRoot(options.dir);
|
|
5623
|
-
const { buildApp } = await import("./dist-
|
|
5454
|
+
const { buildApp } = await import("./dist-SAPlw0EN.mjs");
|
|
5624
5455
|
await buildApp({ root });
|
|
5625
5456
|
process.stdout.write(`Built ${root}\n`);
|
|
5626
5457
|
} catch (error) {
|
|
@@ -5717,7 +5548,7 @@ async function runDeploy(options) {
|
|
|
5717
5548
|
const client = createCliPlatformClient(config);
|
|
5718
5549
|
let source;
|
|
5719
5550
|
if (!options.skipBuild) {
|
|
5720
|
-
const { buildApp } = await import("./dist-
|
|
5551
|
+
const { buildApp } = await import("./dist-SAPlw0EN.mjs");
|
|
5721
5552
|
source = { files: (await buildApp({
|
|
5722
5553
|
root,
|
|
5723
5554
|
collectSources: true,
|
|
@@ -5817,7 +5648,7 @@ function runtimeChildEnv(parentEnv, overrides) {
|
|
|
5817
5648
|
//#region src/project/bootstrap-run.ts
|
|
5818
5649
|
/** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
|
|
5819
5650
|
async function resolveBootstrapRun(options) {
|
|
5820
|
-
const { resolveRuntimeBuildArtifact } = await import("./dist-
|
|
5651
|
+
const { resolveRuntimeBuildArtifact } = await import("./dist-SAPlw0EN.mjs");
|
|
5821
5652
|
const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
|
|
5822
5653
|
const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/bootstrap.mjs");
|
|
5823
5654
|
const args = [`--import=${loader}`];
|
|
@@ -5967,7 +5798,7 @@ async function runDev(options) {
|
|
|
5967
5798
|
process.on("SIGINT", shutdown);
|
|
5968
5799
|
process.on("SIGTERM", shutdown);
|
|
5969
5800
|
try {
|
|
5970
|
-
const { watchApp } = await import("./dist-
|
|
5801
|
+
const { watchApp } = await import("./dist-SAPlw0EN.mjs");
|
|
5971
5802
|
await watchApp({
|
|
5972
5803
|
root,
|
|
5973
5804
|
clean: false,
|
|
@@ -6515,7 +6346,7 @@ async function runStart(options) {
|
|
|
6515
6346
|
const apiPort = Number(new URL(serverUrl).port || 80);
|
|
6516
6347
|
const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
|
|
6517
6348
|
ensureNativeDeps(runtimeNodeModules);
|
|
6518
|
-
const { buildApp } = await import("./dist-
|
|
6349
|
+
const { buildApp } = await import("./dist-SAPlw0EN.mjs");
|
|
6519
6350
|
await buildApp({
|
|
6520
6351
|
root,
|
|
6521
6352
|
clean: false
|