@keystrokehq/cli 0.0.131 → 0.0.132

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/index.mjs CHANGED
@@ -2670,6 +2670,16 @@ const CompleteProjectArtifactResponseSchema = object({
2670
2670
  artifact: ProjectArtifactSchema,
2671
2671
  project: ProjectSchema
2672
2672
  });
2673
+ const ListProjectDeploymentsResponseSchema = object({ deployments: array(object({
2674
+ id: string(),
2675
+ projectId: string(),
2676
+ version: number$1().int().positive(),
2677
+ deployedBy: string().nullable(),
2678
+ deployedByEmail: string().optional(),
2679
+ deployedByAvatarUrl: string().optional(),
2680
+ createdAt: isoDateTime$1,
2681
+ active: boolean()
2682
+ })) });
2673
2683
  const optionalCount = number$1().int().nonnegative().nullable().optional();
2674
2684
  const optionalTimestamp = string().nullable().optional();
2675
2685
  const AgentSummarySchema = object({
@@ -4979,6 +4989,16 @@ function createArtifactsResource(http) {
4979
4989
  }
4980
4990
  };
4981
4991
  }
4992
+ function createDeploymentsResource(http) {
4993
+ return { async listForProject(projectId) {
4994
+ try {
4995
+ const data = await http.get(`/api/projects/${encodeURIComponent(projectId)}/deployments`).json();
4996
+ return ListProjectDeploymentsResponseSchema.parse(data).deployments;
4997
+ } catch (error) {
4998
+ throw await toPlatformError(error);
4999
+ }
5000
+ } };
5001
+ }
4982
5002
  function createGatewayAttachmentsResource(http) {
4983
5003
  const projectPrefix = (projectId) => `/api/projects/${encodeURIComponent(projectId)}/gateways/slack/attachments`;
4984
5004
  return {
@@ -6774,27 +6794,6 @@ const workflowSeed = [{
6774
6794
  stepCount: 4,
6775
6795
  lastRunAt: "2026-05-31T16:40:00Z"
6776
6796
  }];
6777
- const deploymentSeed = [{
6778
- id: "deployment-v002",
6779
- projectId: "project_personal_repo",
6780
- version: "v0.0.2",
6781
- commit: "0842e21",
6782
- commitSha: "0842e21",
6783
- deployedBy: "Dallin Bentley",
6784
- deployedByEmail: "dallin@keystroke.ai",
6785
- createdAt: "2026-04-20T15:44:00Z",
6786
- active: true
6787
- }, {
6788
- id: "deployment-v001",
6789
- projectId: "project_personal_repo",
6790
- version: "v0.0.1",
6791
- commit: "5aeb762",
6792
- commitSha: "5aeb762",
6793
- deployedBy: "Dallin Bentley",
6794
- deployedByEmail: "dallin@keystroke.ai",
6795
- createdAt: "2026-04-18T15:44:00Z",
6796
- active: false
6797
- }];
6798
6797
  /** Review personas for mocked project members and API key authors (not org membership). */
6799
6798
  const mockPersonaSeed = [
6800
6799
  {
@@ -6983,18 +6982,6 @@ function maskSecretPreview(value) {
6983
6982
  if (trimmed.length <= 4) return "•".repeat(Math.max(trimmed.length, 4));
6984
6983
  return `${"•".repeat(Math.min(trimmed.length - 4, 20))}${trimmed.slice(-4)}`;
6985
6984
  }
6986
- function createDeploymentsResource() {
6987
- return { listForProject: mock({
6988
- domain: "deployments",
6989
- method: "listForProject",
6990
- plannedEndpoint: "GET /api/projects/:id/deployments"
6991
- }, async (projectId) => {
6992
- return deploymentSeed.map((deployment) => ({
6993
- ...deployment,
6994
- projectId
6995
- }));
6996
- }) };
6997
- }
6998
6985
  const projectMembersStore = /* @__PURE__ */ new Map();
6999
6986
  function getProjectMembers(projectId) {
7000
6987
  let members = projectMembersStore.get(projectId);
@@ -8560,7 +8547,7 @@ function createPlatformClient(options) {
8560
8547
  apps: createAppsResource(),
8561
8548
  credentials: createCredentialsResource(),
8562
8549
  history: createHistoryResource(),
8563
- deployments: createDeploymentsResource(),
8550
+ deployments: createDeploymentsResource(http),
8564
8551
  gatewayAttachments: createGatewayAttachmentsResource(http),
8565
8552
  projectMetrics: createProjectMetricsResource(http),
8566
8553
  projectFiles: createProjectFilesResource(http),
@@ -10153,6 +10140,12 @@ async function runProjectMetrics(config, options) {
10153
10140
  process.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
10154
10141
  });
10155
10142
  }
10143
+ async function runProjectDeploymentsList(config, options) {
10144
+ await withActivePlatformClient(config, async (platform) => {
10145
+ const deployments = await platform.deployments.listForProject(options.projectId);
10146
+ process.stdout.write(`${JSON.stringify({ deployments }, null, 2)}\n`);
10147
+ });
10148
+ }
10156
10149
  async function runProjectCreate(config, input) {
10157
10150
  await withActivePlatformClient(config, async (platform) => {
10158
10151
  const project = await platform.projects.create(input);
@@ -10225,6 +10218,20 @@ function registerProjectCommand(program) {
10225
10218
  process.exitCode = 1;
10226
10219
  }
10227
10220
  });
10221
+ project.command("deployments").description("View deployment history for platform projects").command("list").description("List deployment history for a project").option("--project <id>", "Project ID").action(async (options) => {
10222
+ const config = createCliConfig();
10223
+ try {
10224
+ const projectId = options.project ?? resolveActiveProjectId(config);
10225
+ if (!projectId) throw new Error("Usage: keystroke project deployments list --project <id>");
10226
+ await runProjectDeploymentsList(config, { projectId });
10227
+ } catch (error) {
10228
+ process.stderr.write(`${formatCliError(error, "List deployments failed", {
10229
+ serverUrl: getPlatformUrl(config),
10230
+ webUrl: getWebUrl(config)
10231
+ })}\n`);
10232
+ process.exitCode = 1;
10233
+ }
10234
+ });
10228
10235
  project.command("create").description("Create a platform project in the active organization").requiredOption("--name <name>", "Project name").option("--description <description>", "Project description").action(async (options) => {
10229
10236
  const config = createCliConfig();
10230
10237
  try {