runline 0.7.0 → 0.7.1

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.
@@ -31,6 +31,14 @@ const PROJECT_FIELDS = `id name description url icon color priority progress hea
31
31
  teams { nodes { id key } } createdAt updatedAt completedAt canceledAt`;
32
32
  const MILESTONE_FIELDS = `id name description targetDate sortOrder project { id name } createdAt updatedAt`;
33
33
  const PROJECT_UPDATE_FIELDS = `id body health url user { id name } project { id name } createdAt`;
34
+ const FEED_ITEM_FIELDS = `id createdAt updatedAt archivedAt team { id key name } user { id name }
35
+ projectUpdate { ${PROJECT_UPDATE_FIELDS} }
36
+ initiativeUpdate { id body health url user { id name } initiative { id name } createdAt }
37
+ post { id title body slugId type creator { id name } createdAt updatedAt }`;
38
+ const CUSTOM_VIEW_FIELDS = `id name description icon color shared slugId modelName
39
+ filterData projectFilterData initiativeFilterData feedItemFilterData
40
+ team { id key name } owner { id name } creator { id name }
41
+ createdAt updatedAt archivedAt`;
34
42
  const CYCLE_FIELDS = `id number name description startsAt endsAt completedAt progress team { id key } createdAt`;
35
43
  const INITIATIVE_FIELDS = `id name description url icon color status targetDate owner { id name }
36
44
  projects { nodes { id name } } createdAt updatedAt completedAt`;
@@ -93,7 +101,7 @@ const LIST_INPUT_SCHEMA = {
93
101
  // ---------- plugin ----------
94
102
  export default function linear(rl) {
95
103
  rl.setName("linear");
96
- rl.setVersion("0.3.0");
104
+ rl.setVersion("0.4.0");
97
105
  rl.setConnectionSchema({
98
106
  apiKey: {
99
107
  type: "string",
@@ -127,6 +135,35 @@ export default function linear(rl) {
127
135
  },
128
136
  });
129
137
  }
138
+ function customViewConnectionAction(name, description, connectionField, filterTypeName, selection, includeSubTeamsDescription) {
139
+ rl.registerAction(name, {
140
+ description,
141
+ inputSchema: {
142
+ viewId: { type: "string", required: true, description: "The custom view ID or slug" },
143
+ ...LIST_INPUT_SCHEMA,
144
+ ...(includeSubTeamsDescription
145
+ ? { includeSubTeams: { type: "boolean", required: false, description: includeSubTeamsDescription } }
146
+ : {}),
147
+ },
148
+ async execute(input, ctx) {
149
+ const opts = (input ?? {});
150
+ const { argsDecl, argsCall, vars } = buildConnArgs(opts, filterTypeName);
151
+ const declParts = ["$id: String!", argsDecl.slice(1, -1)];
152
+ const callParts = [argsCall.slice(1, -1)];
153
+ const includeSubTeamsSet = includeSubTeamsDescription !== undefined && opts.includeSubTeams !== undefined;
154
+ if (includeSubTeamsSet) {
155
+ declParts.push("$includeSubTeams: Boolean");
156
+ callParts.push("includeSubTeams: $includeSubTeams");
157
+ vars.includeSubTeams = opts.includeSubTeams;
158
+ }
159
+ const data = await gql(key(ctx), `query(${declParts.join(", ")}) {
160
+ customView(id: $id) { ${connectionField}(${callParts.join(", ")}) { nodes { ${selection} } pageInfo { hasNextPage endCursor } } }
161
+ }`, { id: opts.viewId, ...vars });
162
+ const conn = (data.customView?.[connectionField] ?? {});
163
+ return { nodes: conn.nodes, pageInfo: conn.pageInfo };
164
+ },
165
+ });
166
+ }
130
167
  // =========================================================
131
168
  // Issues
132
169
  // =========================================================
@@ -712,6 +749,70 @@ export default function linear(rl) {
712
749
  },
713
750
  });
714
751
  // =========================================================
752
+ // Custom Views
753
+ // =========================================================
754
+ listAction("view.list", "List custom views accessible to the user, including personal and shared workspace views. Linear excludes views scoped to a specific project or initiative from this root query.", "customViews", "CustomViewFilter", CUSTOM_VIEW_FIELDS);
755
+ getAction("view.get", "Get a custom view by ID or slug.", "customView", CUSTOM_VIEW_FIELDS);
756
+ rl.registerAction("view.create", {
757
+ description: "Create a custom view. Set filterData for issue views; projectFilterData, initiativeFilterData, or feedItemFilterData for other view types.",
758
+ inputSchema: {
759
+ name: { type: "string", required: true, description: "The name of the custom view" },
760
+ description: { type: "string", required: false, description: "The description of the custom view" },
761
+ icon: { type: "string", required: false, description: "The icon of the custom view" },
762
+ color: { type: "string", required: false, description: "The color of the custom view icon (hex)" },
763
+ shared: { type: "boolean", required: false, description: "Whether the custom view is shared with everyone in the workspace" },
764
+ filterData: { type: "object", required: false, description: "IssueFilter for issue views" },
765
+ projectFilterData: { type: "object", required: false, description: "ProjectFilter for project views" },
766
+ initiativeFilterData: { type: "object", required: false, description: "InitiativeFilter for initiative views" },
767
+ feedItemFilterData: { type: "object", required: false, description: "FeedItemFilter for update/feed item views" },
768
+ teamId: { type: "string", required: false, description: "The team associated with the custom view" },
769
+ projectId: { type: "string", required: false, description: "The project associated with the custom view" },
770
+ initiativeId: { type: "string", required: false, description: "The initiative associated with the custom view" },
771
+ ownerId: { type: "string", required: false, description: "The owner of the custom view" },
772
+ id: { type: "string", required: false, description: "The identifier in UUID v4 format. If none is provided, the backend will generate one" },
773
+ },
774
+ async execute(input, ctx) {
775
+ const data = await gql(key(ctx), `mutation($input: CustomViewCreateInput!) { customViewCreate(input: $input) { success customView { ${CUSTOM_VIEW_FIELDS} } } }`, { input: input });
776
+ return data.customViewCreate?.customView;
777
+ },
778
+ });
779
+ rl.registerAction("view.update", {
780
+ description: "Update a custom view. All fields optional; only provided fields are updated.",
781
+ inputSchema: {
782
+ id: { type: "string", required: true, description: "The identifier of the custom view to update" },
783
+ name: { type: "string", required: false, description: "The name of the custom view" },
784
+ description: { type: "string", required: false, description: "The description of the custom view" },
785
+ icon: { type: "string", required: false, description: "The icon of the custom view" },
786
+ color: { type: "string", required: false, description: "The color of the custom view icon (hex)" },
787
+ shared: { type: "boolean", required: false, description: "Whether the custom view is shared with everyone in the workspace" },
788
+ filterData: { type: "object", required: false, description: "IssueFilter for issue views" },
789
+ projectFilterData: { type: "object", required: false, description: "ProjectFilter for project views" },
790
+ initiativeFilterData: { type: "object", required: false, description: "InitiativeFilter for initiative views" },
791
+ feedItemFilterData: { type: "object", required: false, description: "FeedItemFilter for update/feed item views" },
792
+ teamId: { type: "string", required: false, description: "The team associated with the custom view" },
793
+ projectId: { type: "string", required: false, description: "The project associated with the custom view" },
794
+ initiativeId: { type: "string", required: false, description: "The initiative associated with the custom view" },
795
+ ownerId: { type: "string", required: false, description: "The owner of the custom view" },
796
+ },
797
+ async execute(input, ctx) {
798
+ const { id, ...fields } = input;
799
+ const data = await gql(key(ctx), `mutation($id: String!, $input: CustomViewUpdateInput!) { customViewUpdate(id: $id, input: $input) { success customView { ${CUSTOM_VIEW_FIELDS} } } }`, { id, input: fields });
800
+ return data.customViewUpdate?.customView;
801
+ },
802
+ });
803
+ rl.registerAction("view.delete", {
804
+ description: "Delete a custom view.",
805
+ inputSchema: { id: { type: "string", required: true, description: "The identifier of the custom view to delete" } },
806
+ async execute(input, ctx) {
807
+ const data = await gql(key(ctx), `mutation($id: String!) { customViewDelete(id: $id) { success } }`, { id: input.id });
808
+ return data.customViewDelete;
809
+ },
810
+ });
811
+ customViewConnectionAction("view.issues", "List issues matching a custom view's issue filter. Returns an empty connection when the view's modelName is not Issue.", "issues", "IssueFilter", ISSUE_LITE, "Include issues from sub-teams when the custom view is associated with a team");
812
+ customViewConnectionAction("view.projects", "List projects matching a custom view's project filter. Returns an empty connection when the view's modelName is not Project.", "projects", "ProjectFilter", PROJECT_FIELDS, "Include projects from sub-teams when the custom view is associated with a team");
813
+ customViewConnectionAction("view.initiatives", "List initiatives matching a custom view's initiative filter. Returns an empty connection when the view's modelName is not Initiative.", "initiatives", "InitiativeFilter", INITIATIVE_FIELDS);
814
+ customViewConnectionAction("view.updates", "List feed items matching a custom view's feed item filter. Returns an empty connection when the view's modelName is not FeedItem.", "updates", "FeedItemFilter", FEED_ITEM_FIELDS, "Include updates from sub-teams when the custom view is associated with a team");
815
+ // =========================================================
715
816
  // Cycles
716
817
  // =========================================================
717
818
  listAction("cycle.list", "List cycles. Use filter for isActive/isNext/isPrevious.", "cycles", "CycleFilter", CYCLE_FIELDS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runline",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Code mode for agents — turn any API or command into a callable action",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",