@openforge-app/plugin-sdk 0.2.5 → 0.2.6

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/domain.d.ts CHANGED
@@ -117,6 +117,7 @@ export interface PrComment {
117
117
  outdated: number;
118
118
  created_at: number;
119
119
  }
120
+ export type PullRequestMergeMethod = 'merge' | 'squash' | 'rebase';
120
121
  export interface PullRequestInfo {
121
122
  id: number;
122
123
  pr_number: number;
@@ -149,6 +150,9 @@ export interface PullRequestInfo {
149
150
  merge_queue_required: boolean | null;
150
151
  merge_queue_state: string | null;
151
152
  readiness_updated_at: number | null;
153
+ merge_methods_policy_known?: boolean | null;
154
+ allowed_merge_methods?: string | PullRequestMergeMethod[] | null;
155
+ default_merge_method?: PullRequestMergeMethod | null;
152
156
  }
153
157
  export type PollOutcome = 'completed' | 'missing_github_token' | 'github_token_unavailable' | 'failed' | 'rate_limited';
154
158
  export interface PollResult {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { BrowserSurfaceCapture, BrowserSurfaceFeedbackSelection, BrowserSur
3
3
  export { OPENFORGE_PACKAGE_METADATA_SCHEMA, OPENFORGE_PLUGIN_CAPABILITIES, isOpenForgePackageMetadata, isPluginPackageMetadata, isSupportedOpenForgeApiVersion, validateOpenForgePackageMetadata, validatePluginPackageMetadata, } from './manifest';
4
4
  export { createMemoryPluginStorage, createMockBackendOpenForgeApi, createMockFrontendOpenForgeApi, createMockOpenForgeApi, createMockPluginContext, createOpenForgeRegistryFake, createTestingCalls, TestingOpenForgeRegistryFake, TestingSubscriptionSink, } from './testing';
5
5
  export { DEFAULT_EXTERNAL_TEXT_FILE_CHUNK_SIZE_BYTES, MAX_EXTERNAL_TEXT_FILE_CHUNK_SIZE_BYTES, MIN_EXTERNAL_TEXT_FILE_CHUNK_SIZE_BYTES, TaskFollowUpError, MAX_SUPPORTED_API_VERSION, MIN_SUPPORTED_API_VERSION, OPENFORGE_PLUGIN_API_VERSION, SUPPORTED_OPENFORGE_API_VERSIONS, isPluginViewKey, resolveExternalTextFileChunkSize, makePluginViewKey, parsePluginViewKey, } from './types';
6
- export type { AgentCommandDescriptor, AgentCommandMetadata, AgentCommandRuntime, AttentionAPI, BackendReadyState, CommandDescriptor, CommandRegistry, CommandRegistration, CommandShortcutMetadata, ComposeTaskRequest, ComposeTaskResult, ConfigureStartPromptContributionRequest, CreateTaskRequest, Disposable, BackendFileSystemAPI, ExternalReadDirectoryRequest, ExternalReadFileRequest, ExternalReadTextFileChunksRequest, ExternalReadFileSystemAPI, FileSystemAPI, UserDataDirectoryRequest, UserDataFileRequest, UserDataFileSystemAPI, UserDataFileWriteRequest, ImplementationRun, InjectionPointLocation, JsonObject, JsonPrimitive, JsonSchema, JsonValue, MaybePromise, KeyValueConfigAPI, NotificationRequest, NavigationAPI, NotificationsAPI, OpenForgeCommonAPI, OpenForgeContextChangeHandler, OpenForgeContextSnapshot, OpenForgeNavigationRequest, OpenForgeNavigationSnapshot, OpenForgePackageMetadata, OpenForgePluginCapability, OpenForgePluginContext, OpenForgePluginPackageJson, PluginCommandInvocationContext, PluginCommandInvocationSource, PluginComponentLoader, PluginComponentModule, PluginEntry, PluginIcon, PluginSidebarNavigationProps, PluginSidebarViewIdentity, PluginInjectionPointProps, PluginSettingsSectionProps, PluginState, PluginSvgIcon, PluginTaskPaneProps, PluginTaskUISectionProps, PluginViewProps, PluginStorage, PluginStorageScope, PluginViewKey, ProjectsAPI, PtyBufferState, ShellAPI, ShellResizeRequest, TaskStartPrefixContext, TaskStartPrefixProviderRegistration, TerminalImageProtocol, ShellSessionRequest, ShellSpawnRequest, ShellWriteRequest, StartPromptContribution, SendTaskFollowUpRequest, StartTaskImplementationRequest, TaskFollowUpDisposition, TaskFollowUpErrorCode, TaskFollowUpReceipt, SubscriptionSink, SupportedOpenForgeApiVersion, SystemAPI, TaskLinkHandler, TaskLinkHandlerResult, TaskLinkOpenRequest, TaskLinksAPI, TasksAPI, ValidationError, } from './types';
6
+ export type { AgentCommandDescriptor, AgentCommandMetadata, AgentCommandRuntime, AttentionAPI, BackendReadyState, CommandDescriptor, CommandRegistry, CommandRegistration, CommandShortcutMetadata, ComposeTaskRequest, ComposeTaskResult, ConfigureStartPromptContributionRequest, CreateTaskRequest, Disposable, BackendFileSystemAPI, ExternalReadDirectoryRequest, ExternalReadFileRequest, ExternalReadTextFileChunksRequest, ExternalReadFileSystemAPI, FileSystemAPI, UserDataDirectoryRequest, UserDataFileRequest, UserDataFileSystemAPI, UserDataFileWriteRequest, ImplementationRun, InjectionPointLocation, JsonObject, JsonPrimitive, JsonSchema, JsonValue, MaybePromise, KeyValueConfigAPI, NotificationRequest, NavigationAPI, NotificationsAPI, OpenForgeCommonAPI, OpenForgeContextChangeHandler, OpenForgeContextSnapshot, OpenForgeNavigationRequest, OpenForgeNavigationSnapshot, OpenForgePackageMetadata, OpenForgePluginCapability, OpenForgePluginContext, OpenForgePluginPackageJson, PluginCommandInvocationContext, PluginCommandInvocationSource, PluginComponentLoader, PluginComponentModule, PluginEntry, PluginIcon, PluginSidebarNavigationProps, PluginSidebarViewIdentity, PluginInjectionPointProps, PluginSettingsSectionProps, PluginState, PluginSvgIcon, PluginTaskPaneProps, PluginTaskUISectionProps, PluginViewProps, PluginStorage, PluginStorageScope, PluginViewKey, ProjectsAPI, PtyBufferState, ShellAPI, ShellResizeRequest, TaskStartPrefixContext, TaskStartPrefixProviderRegistration, TerminalImageProtocol, ShellSessionRequest, ShellSpawnRequest, ShellTerminalQueryResponseRequest, ShellWriteRequest, StartPromptContribution, SendTaskFollowUpRequest, StartTaskImplementationRequest, TaskFollowUpDisposition, TaskFollowUpErrorCode, TaskFollowUpReceipt, SubscriptionSink, SupportedOpenForgeApiVersion, SystemAPI, TaskLinkHandler, TaskLinkHandlerResult, TaskLinkOpenRequest, TaskLinksAPI, TasksAPI, ValidationError, } from './types';
7
7
  export type { MockBackendOpenForgeAPI, MockFrontendOpenForgeAPI, TestingBackgroundServiceContribution, TestingBackendMethodContribution, TestingCommandContribution, TestingContributionBase, TestingExternalTextFile, TestingExternalTextFileChunksCall, TestingEventListenerContribution, TestingOpenForgeApiCalls, TestingOpenForgeApiOptions, TestingOpenForgeRegistrySnapshot, TestingRuntimeKind, TestingRuntimeScope, TestingSettingsSectionContribution, TestingTaskPaneTabContribution, TestingTaskUISectionContribution, TestingViewContribution, } from './testing';
8
8
  export { parseStrictFiniteNumber } from './numberParsing';
9
9
  export { buildProjectFileTree, flattenVisibleProjectFileTree, formatProjectFileTreeSize, getProjectFileTreeDepth, getProjectFileTreeItemAccessibility, getProjectFileTreeKeyboardAction, getProjectFileTreeParentPath, hasProjectFileTreeShortcutModifier, projectFileTreePathToId, } from './projectFileTree';
@@ -1,8 +1,9 @@
1
- import { type MergeReadinessAction, type MergeReadinessDetail, type MergeReadinessStatus, type MergeStatusInfo } from './domain';
1
+ import { type MergeReadinessAction, type MergeReadinessDetail, type MergeReadinessStatus, type MergeStatusInfo, type PullRequestMergeMethod } from './domain';
2
2
  export type PrChipSurface = 'compact' | 'detail';
3
3
  export type PrChipVariant = 'success' | 'error' | 'pending' | 'muted' | 'neutral' | 'done' | 'merged' | 'closed';
4
4
  export type PrChipType = 'draft' | 'ci' | 'review' | 'merge';
5
5
  export type PrChipIcon = 'check' | 'cross' | 'clock' | null;
6
+ export declare function getPullRequestMergeActionLabel(method: PullRequestMergeMethod, prNumber?: number): string;
6
7
  export interface PrStatusChipSpec {
7
8
  type: PrChipType;
8
9
  label: string;
@@ -1,4 +1,15 @@
1
1
  import { getMergeReadiness, isClosedUnmergedPullRequest, isMergedPullRequest } from './domain';
2
+ const PULL_REQUEST_MERGE_ACTION_LABELS = {
3
+ merge: 'Create a merge commit',
4
+ squash: 'Squash and merge',
5
+ rebase: 'Rebase and merge',
6
+ };
7
+ export function getPullRequestMergeActionLabel(method, prNumber) {
8
+ const label = PULL_REQUEST_MERGE_ACTION_LABELS[method];
9
+ if (prNumber === undefined)
10
+ return label;
11
+ return method === 'merge' ? `${label} for PR #${prNumber}` : `${label} PR #${prNumber}`;
12
+ }
2
13
  export function getPrStatusChips(pr, surface) {
3
14
  const chips = [];
4
15
  if (pr.draft && pr.state === 'open') {
@@ -146,6 +146,7 @@ export class TestingCommonApiFake {
146
146
  write: async (request) => {
147
147
  this.services.calls.shellWrites.push(request);
148
148
  },
149
+ writeTerminalQueryResponse: async () => { },
149
150
  resize: async (request) => {
150
151
  this.services.calls.shellResizes.push(request);
151
152
  },
@@ -154,7 +155,7 @@ export class TestingCommonApiFake {
154
155
  },
155
156
  getBuffer: async (request) => {
156
157
  this.services.calls.shellBuffers.push(request);
157
- return { buffer: null, isLive: false };
158
+ return { buffer: null, isLive: false, instanceId: null };
158
159
  },
159
160
  },
160
161
  notifications: {
package/dist/types.d.ts CHANGED
@@ -432,6 +432,10 @@ export interface ShellSpawnRequest extends ShellSessionRequest {
432
432
  export interface ShellWriteRequest extends ShellSessionRequest {
433
433
  data: string;
434
434
  }
435
+ export interface ShellTerminalQueryResponseRequest extends ShellSessionRequest {
436
+ ptyInstanceId: number;
437
+ data: string;
438
+ }
435
439
  export interface ShellResizeRequest extends ShellSessionRequest {
436
440
  cols: number;
437
441
  rows: number;
@@ -439,10 +443,12 @@ export interface ShellResizeRequest extends ShellSessionRequest {
439
443
  export interface PtyBufferState {
440
444
  buffer: string | null;
441
445
  isLive: boolean;
446
+ instanceId: number | null;
442
447
  }
443
448
  export interface ShellAPI {
444
449
  spawn(request: ShellSpawnRequest): Promise<number>;
445
450
  write(request: ShellWriteRequest): Promise<void>;
451
+ writeTerminalQueryResponse(request: ShellTerminalQueryResponseRequest): Promise<void>;
446
452
  resize(request: ShellResizeRequest): Promise<void>;
447
453
  kill(request: ShellSessionRequest): Promise<void>;
448
454
  getBuffer(request: ShellSessionRequest): Promise<PtyBufferState>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openforge-app/plugin-sdk",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
package/dist/context.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import type { Disposable, OpenForgeContextChangeHandler, OpenForgePackageMetadata, OpenForgePluginContext, SubscriptionSink, SupportedOpenForgeApiVersion } from './types';
2
- declare class SubscriptionSet implements SubscriptionSink {
3
- private readonly subscriptions;
4
- add(subscription: Disposable | (() => void)): void;
5
- disposeAll(): Promise<void>;
6
- }
7
- export declare class PluginContextImpl implements OpenForgePluginContext {
8
- readonly pluginId: string;
9
- readonly apiVersion: SupportedOpenForgeApiVersion;
10
- readonly packageMetadata: OpenForgePackageMetadata;
11
- readonly subscriptions: SubscriptionSet;
12
- onDidChange(_handler: OpenForgeContextChangeHandler): Disposable;
13
- constructor(pluginId: string, apiVersion: SupportedOpenForgeApiVersion, packageMetadata: OpenForgePackageMetadata);
14
- }
15
- export {};
package/dist/context.js DELETED
@@ -1,33 +0,0 @@
1
- class SubscriptionSet {
2
- subscriptions = new Set();
3
- add(subscription) {
4
- this.subscriptions.add(subscription);
5
- }
6
- async disposeAll() {
7
- const subscriptions = [...this.subscriptions];
8
- this.subscriptions.clear();
9
- await Promise.all(subscriptions.map(async (subscription) => {
10
- if (typeof subscription === 'function') {
11
- subscription();
12
- }
13
- else {
14
- await subscription.dispose();
15
- }
16
- }));
17
- }
18
- }
19
- export class PluginContextImpl {
20
- pluginId;
21
- apiVersion;
22
- packageMetadata;
23
- subscriptions;
24
- onDidChange(_handler) {
25
- return { dispose: () => undefined };
26
- }
27
- constructor(pluginId, apiVersion, packageMetadata) {
28
- this.pluginId = pluginId;
29
- this.apiVersion = apiVersion;
30
- this.packageMetadata = packageMetadata;
31
- this.subscriptions = new SubscriptionSet();
32
- }
33
- }