@keystrokehq/cli 0.0.127 → 0.0.128

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,25 @@ const WorkflowSummaryListResponseSchema = array(WorkflowSummarySchema);
2670
2670
  const WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();
2671
2671
  const SkillSummaryListResponseSchema = array(SkillSummarySchema);
2672
2672
  const SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();
2673
+ const RecentResourceKindSchema = _enum([
2674
+ "agent",
2675
+ "workflow",
2676
+ "skill"
2677
+ ]);
2678
+ const RecentResourceSourceSchema = _enum(["owned", "shared"]);
2679
+ const RecentResourceListResponseSchema = array(object({
2680
+ id: string().min(1),
2681
+ resourceKind: RecentResourceKindSchema,
2682
+ resourceId: string().min(1),
2683
+ name: string().min(1),
2684
+ description: string().optional(),
2685
+ projectId: string().min(1),
2686
+ projectName: string().min(1),
2687
+ sourcePath: string().min(1).optional(),
2688
+ source: RecentResourceSourceSchema,
2689
+ lastOpenedAt: string().min(1),
2690
+ lastModifiedAt: string().min(1)
2691
+ }));
2673
2692
  const isoDateTime = string().datetime();
2674
2693
  const sha256Hex = string().regex(/^[a-f0-9]{64}$/, "Expected a lowercase hex sha256 digest");
2675
2694
  /**
@@ -5176,6 +5195,16 @@ function createSkillsResource(http) {
5176
5195
  }
5177
5196
  };
5178
5197
  }
5198
+ function createRecentsResource(http) {
5199
+ return { async list() {
5200
+ try {
5201
+ const data = await http.get("/api/recents").json();
5202
+ return RecentResourceListResponseSchema.parse(data);
5203
+ } catch (error) {
5204
+ throw await toPlatformError(error);
5205
+ }
5206
+ } };
5207
+ }
5179
5208
  const DEFAULT_PROJECT_SETTINGS = {
5180
5209
  description: "",
5181
5210
  defaultRole: "editor",
@@ -6704,21 +6733,6 @@ const workflowSeed = [{
6704
6733
  stepCount: 4,
6705
6734
  lastRunAt: "2026-05-31T16:40:00Z"
6706
6735
  }];
6707
- const skillSeed = [{
6708
- id: "skill-attio-sync",
6709
- name: "Attio Sync",
6710
- projectId: "project_personal_repo",
6711
- updatedAt: "2026-06-01T18:05:00Z",
6712
- description: "Enrich company and contact records from Attio.",
6713
- sourcePath: ".agents/skills/attio-sync/SKILL.md"
6714
- }, {
6715
- id: "skill-doc-coauthor",
6716
- name: "Doc Co-author",
6717
- projectId: "project_personal_repo",
6718
- updatedAt: "2026-05-30T10:24:00Z",
6719
- description: "Collaborative writing, editing, and version tracking for docs.",
6720
- sourcePath: ".agents/skills/doc-coauthor/SKILL.md"
6721
- }];
6722
6736
  const deploymentSeed = [{
6723
6737
  id: "deployment-v002",
6724
6738
  projectId: "project_personal_repo",
@@ -6814,75 +6828,6 @@ const apiKeySeed = [
6814
6828
  }
6815
6829
  ];
6816
6830
  let credentialRecords = [...credentialSeed];
6817
- const recentProjectNameById = { project_personal_repo: "Blake's Project" };
6818
- function laterIso(a, b) {
6819
- return new Date(a).getTime() >= new Date(b).getTime() ? a : b;
6820
- }
6821
- function hoursBefore(iso, hours) {
6822
- return (/* @__PURE__ */ new Date(new Date(iso).getTime() - hours * 36e5)).toISOString();
6823
- }
6824
- function buildRecentResourceSeed() {
6825
- const agentRecents = agentSeed.map((agent, index) => {
6826
- const lastModifiedAt = agent.updatedAt;
6827
- const lastOpenedAt = hoursBefore(lastModifiedAt, index * 5 + 2);
6828
- return {
6829
- id: `recent-agent-${agent.id}`,
6830
- resourceKind: "agent",
6831
- resourceId: agent.id,
6832
- name: agent.name,
6833
- description: agent.description,
6834
- projectId: agent.projectId,
6835
- projectName: recentProjectNameById[agent.projectId] ?? agent.projectId,
6836
- sourcePath: agent.sourcePath,
6837
- source: "owned",
6838
- lastOpenedAt,
6839
- lastModifiedAt
6840
- };
6841
- });
6842
- const workflowRecents = workflowSeed.map((workflow, index) => {
6843
- const lastModifiedAt = workflow.updatedAt;
6844
- const lastOpenedAt = hoursBefore(lastModifiedAt, index * 4 + 6);
6845
- return {
6846
- id: `recent-workflow-${workflow.id}`,
6847
- resourceKind: "workflow",
6848
- resourceId: workflow.id,
6849
- name: workflow.name,
6850
- description: workflow.description,
6851
- projectId: workflow.projectId,
6852
- projectName: recentProjectNameById[workflow.projectId] ?? workflow.projectId,
6853
- sourcePath: workflow.sourcePath,
6854
- source: "owned",
6855
- lastOpenedAt,
6856
- lastModifiedAt
6857
- };
6858
- });
6859
- const skillRecents = skillSeed.map((skill, index) => {
6860
- const lastModifiedAt = skill.updatedAt;
6861
- const lastOpenedAt = hoursBefore(lastModifiedAt, index * 3 + 1);
6862
- return {
6863
- id: `recent-skill-${skill.id}`,
6864
- resourceKind: "skill",
6865
- resourceId: skill.id,
6866
- name: skill.name,
6867
- description: skill.description,
6868
- projectId: skill.projectId,
6869
- projectName: recentProjectNameById[skill.projectId] ?? skill.projectId,
6870
- sourcePath: skill.sourcePath,
6871
- source: "owned",
6872
- lastOpenedAt,
6873
- lastModifiedAt
6874
- };
6875
- });
6876
- return [
6877
- ...agentRecents,
6878
- ...workflowRecents,
6879
- ...skillRecents
6880
- ].sort((left, right) => {
6881
- const leftAt = laterIso(left.lastOpenedAt, left.lastModifiedAt);
6882
- const rightAt = laterIso(right.lastOpenedAt, right.lastModifiedAt);
6883
- return new Date(rightAt).getTime() - new Date(leftAt).getTime();
6884
- });
6885
- }
6886
6831
  function createMockApiKeySecret() {
6887
6832
  const secret = `sk_${`${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`}`;
6888
6833
  return {
@@ -7106,13 +7051,6 @@ function createApiKeysResource() {
7106
7051
  })
7107
7052
  };
7108
7053
  }
7109
- function createRecentsResource() {
7110
- return { list: mock({
7111
- domain: "recents",
7112
- method: "list",
7113
- plannedEndpoint: "GET /api/recents"
7114
- }, async () => buildRecentResourceSeed()) };
7115
- }
7116
7054
  const historyProjectNameById = { project_personal_repo: "Blake's Project" };
7117
7055
  const MOCK_ACTOR = {
7118
7056
  userId: "user_blake",
@@ -8633,7 +8571,7 @@ function createPlatformClient(options) {
8633
8571
  members: createMembersResource(http),
8634
8572
  invitations: createInvitationsResource(http),
8635
8573
  apiKeys: createApiKeysResource(),
8636
- recents: createRecentsResource(),
8574
+ recents: createRecentsResource(http),
8637
8575
  userPreferences: createUserPreferencesResource({ getCurrentUserId: options.getCurrentUserId }),
8638
8576
  userAvatar: createUserAvatarResource(http),
8639
8577
  organizationSidebarBranding: createOrganizationSidebarBrandingResource({ getActiveOrganizationId: () => activeOrganizationId }),