@keystrokehq/cli 0.0.112 → 0.0.113

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
@@ -2620,6 +2620,44 @@ const CompleteProjectArtifactResponseSchema = object({
2620
2620
  artifact: ProjectArtifactSchema,
2621
2621
  project: ProjectSchema
2622
2622
  });
2623
+ const optionalCount = number$1().int().nonnegative().nullable().optional();
2624
+ const optionalTimestamp = string().nullable().optional();
2625
+ const AgentSummarySchema = object({
2626
+ id: string().min(1),
2627
+ name: string().min(1),
2628
+ projectId: string().min(1),
2629
+ updatedAt: string().min(1),
2630
+ description: string().optional(),
2631
+ sourcePath: string().min(1).optional(),
2632
+ model: string().optional(),
2633
+ toolCount: optionalCount,
2634
+ credentialCount: optionalCount,
2635
+ lastRunAt: optionalTimestamp
2636
+ });
2637
+ const WorkflowSummarySchema = object({
2638
+ id: string().min(1),
2639
+ name: string().min(1),
2640
+ projectId: string().min(1),
2641
+ updatedAt: string().min(1),
2642
+ description: string().optional(),
2643
+ sourcePath: string().min(1).optional(),
2644
+ stepCount: optionalCount,
2645
+ lastRunAt: optionalTimestamp
2646
+ });
2647
+ const SkillSummarySchema = object({
2648
+ id: string().min(1),
2649
+ name: string().min(1),
2650
+ projectId: string().min(1),
2651
+ updatedAt: string().min(1),
2652
+ description: string().optional(),
2653
+ sourcePath: string().min(1).optional()
2654
+ });
2655
+ const AgentSummaryListResponseSchema = array(AgentSummarySchema);
2656
+ const AgentSummaryDetailResponseSchema = AgentSummarySchema.nullable();
2657
+ const WorkflowSummaryListResponseSchema = array(WorkflowSummarySchema);
2658
+ const WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();
2659
+ const SkillSummaryListResponseSchema = array(SkillSummarySchema);
2660
+ const SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();
2623
2661
  const isoDateTime = string().datetime();
2624
2662
  const sha256Hex = string().regex(/^[a-f0-9]{64}$/, "Expected a lowercase hex sha256 digest");
2625
2663
  /**
@@ -3411,6 +3449,66 @@ function createProjectsResource(http) {
3411
3449
  }
3412
3450
  };
3413
3451
  }
3452
+ function createAgentsResource(http) {
3453
+ return {
3454
+ async list() {
3455
+ try {
3456
+ const data = await http.get("/api/agents").json();
3457
+ return AgentSummaryListResponseSchema.parse(data);
3458
+ } catch (error) {
3459
+ throw await toPlatformError(error);
3460
+ }
3461
+ },
3462
+ async get(agentId) {
3463
+ try {
3464
+ const data = await http.get(`/api/agents/${encodeURIComponent(agentId)}`).json();
3465
+ return AgentSummaryDetailResponseSchema.parse(data);
3466
+ } catch (error) {
3467
+ throw await toPlatformError(error);
3468
+ }
3469
+ }
3470
+ };
3471
+ }
3472
+ function createWorkflowsResource(http) {
3473
+ return {
3474
+ async list() {
3475
+ try {
3476
+ const data = await http.get("/api/workflows").json();
3477
+ return WorkflowSummaryListResponseSchema.parse(data);
3478
+ } catch (error) {
3479
+ throw await toPlatformError(error);
3480
+ }
3481
+ },
3482
+ async get(workflowId) {
3483
+ try {
3484
+ const data = await http.get(`/api/workflows/${encodeURIComponent(workflowId)}`).json();
3485
+ return WorkflowSummaryDetailResponseSchema.parse(data);
3486
+ } catch (error) {
3487
+ throw await toPlatformError(error);
3488
+ }
3489
+ }
3490
+ };
3491
+ }
3492
+ function createSkillsResource(http) {
3493
+ return {
3494
+ async list() {
3495
+ try {
3496
+ const data = await http.get("/api/skills").json();
3497
+ return SkillSummaryListResponseSchema.parse(data);
3498
+ } catch (error) {
3499
+ throw await toPlatformError(error);
3500
+ }
3501
+ },
3502
+ async get(skillId) {
3503
+ try {
3504
+ const data = await http.get(`/api/skills/${encodeURIComponent(skillId)}`).json();
3505
+ return SkillSummaryDetailResponseSchema.parse(data);
3506
+ } catch (error) {
3507
+ throw await toPlatformError(error);
3508
+ }
3509
+ }
3510
+ };
3511
+ }
3414
3512
  const DEFAULT_PROJECT_SETTINGS = {
3415
3513
  description: "",
3416
3514
  defaultRole: "editor",
@@ -5125,48 +5223,6 @@ function createMockApiKeySecret() {
5125
5223
  keyPreview: `******${secret.slice(-4)}`
5126
5224
  };
5127
5225
  }
5128
- function createAgentsResource() {
5129
- return {
5130
- list: mock({
5131
- domain: "agents",
5132
- method: "list",
5133
- plannedEndpoint: "GET /api/agents"
5134
- }, async () => agentSeed),
5135
- get: mock({
5136
- domain: "agents",
5137
- method: "get",
5138
- plannedEndpoint: "GET /api/agents/:id"
5139
- }, async (agentId) => agentSeed.find((agent) => agent.id === agentId) ?? null)
5140
- };
5141
- }
5142
- function createWorkflowsResource() {
5143
- return {
5144
- list: mock({
5145
- domain: "workflows",
5146
- method: "list",
5147
- plannedEndpoint: "GET /api/workflows"
5148
- }, async () => workflowSeed),
5149
- get: mock({
5150
- domain: "workflows",
5151
- method: "get",
5152
- plannedEndpoint: "GET /api/workflows/:id"
5153
- }, async (workflowId) => workflowSeed.find((workflow) => workflow.id === workflowId) ?? null)
5154
- };
5155
- }
5156
- function createSkillsResource() {
5157
- return {
5158
- list: mock({
5159
- domain: "skills",
5160
- method: "list",
5161
- plannedEndpoint: "GET /api/skills"
5162
- }, async () => skillSeed),
5163
- get: mock({
5164
- domain: "skills",
5165
- method: "get",
5166
- plannedEndpoint: "GET /api/skills/:id"
5167
- }, async (skillId) => skillSeed.find((skill) => skill.id === skillId) ?? null)
5168
- };
5169
- }
5170
5226
  function createAppsResource() {
5171
5227
  return { listCatalog: mock({
5172
5228
  domain: "apps",
@@ -6899,9 +6955,9 @@ function createPlatformClient(options) {
6899
6955
  projects: createProjectsResource(http),
6900
6956
  artifacts: createArtifactsResource(http),
6901
6957
  projectSettings: createProjectSettingsResource(),
6902
- agents: createAgentsResource(),
6903
- workflows: createWorkflowsResource(),
6904
- skills: createSkillsResource(),
6958
+ agents: createAgentsResource(http),
6959
+ workflows: createWorkflowsResource(http),
6960
+ skills: createSkillsResource(http),
6905
6961
  apps: createAppsResource(),
6906
6962
  credentials: createCredentialsResource(),
6907
6963
  history: createHistoryResource(),