Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions dotnet/src/Generated/Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@
// AUTO-GENERATED FILE - DO NOT EDIT
// Generated from: api.schema.json

using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
using StreamJsonRpc;

namespace GitHub.Copilot.SDK.Rpc;

/// <summary>Diagnostic IDs for the Copilot SDK.</summary>
internal static class Diagnostics
{
/// <summary>Indicates an experimental API that may change or be removed.</summary>
internal const string Experimental = "GHCP001";
}

/// <summary>RPC data type for Ping operations.</summary>
public class PingResult
{
Expand Down Expand Up @@ -427,6 +435,7 @@ internal class SessionWorkspaceCreateFileRequest
}

/// <summary>RPC data type for SessionFleetStart operations.</summary>
[Experimental(Diagnostics.Experimental)]
public class SessionFleetStartResult
{
/// <summary>Whether fleet mode was successfully activated.</summary>
Expand All @@ -435,6 +444,7 @@ public class SessionFleetStartResult
}

/// <summary>RPC data type for SessionFleetStart operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal class SessionFleetStartRequest
{
/// <summary>Target session identifier.</summary>
Expand Down Expand Up @@ -463,6 +473,7 @@ public class Agent
}

/// <summary>RPC data type for SessionAgentList operations.</summary>
[Experimental(Diagnostics.Experimental)]
public class SessionAgentListResult
{
/// <summary>Available custom agents.</summary>
Expand All @@ -471,6 +482,7 @@ public class SessionAgentListResult
}

/// <summary>RPC data type for SessionAgentList operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal class SessionAgentListRequest
{
/// <summary>Target session identifier.</summary>
Expand All @@ -495,6 +507,7 @@ public class SessionAgentGetCurrentResultAgent
}

/// <summary>RPC data type for SessionAgentGetCurrent operations.</summary>
[Experimental(Diagnostics.Experimental)]
public class SessionAgentGetCurrentResult
{
/// <summary>Currently selected custom agent, or null if using the default agent.</summary>
Expand All @@ -503,6 +516,7 @@ public class SessionAgentGetCurrentResult
}

/// <summary>RPC data type for SessionAgentGetCurrent operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal class SessionAgentGetCurrentRequest
{
/// <summary>Target session identifier.</summary>
Expand All @@ -527,6 +541,7 @@ public class SessionAgentSelectResultAgent
}

/// <summary>RPC data type for SessionAgentSelect operations.</summary>
[Experimental(Diagnostics.Experimental)]
public class SessionAgentSelectResult
{
/// <summary>The newly selected custom agent.</summary>
Expand All @@ -535,6 +550,7 @@ public class SessionAgentSelectResult
}

/// <summary>RPC data type for SessionAgentSelect operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal class SessionAgentSelectRequest
{
/// <summary>Target session identifier.</summary>
Expand All @@ -547,11 +563,13 @@ internal class SessionAgentSelectRequest
}

/// <summary>RPC data type for SessionAgentDeselect operations.</summary>
[Experimental(Diagnostics.Experimental)]
public class SessionAgentDeselectResult
{
}

/// <summary>RPC data type for SessionAgentDeselect operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal class SessionAgentDeselectRequest
{
/// <summary>Target session identifier.</summary>
Expand All @@ -560,6 +578,7 @@ internal class SessionAgentDeselectRequest
}

/// <summary>RPC data type for SessionCompactionCompact operations.</summary>
[Experimental(Diagnostics.Experimental)]
public class SessionCompactionCompactResult
{
/// <summary>Whether compaction completed successfully.</summary>
Expand All @@ -576,6 +595,7 @@ public class SessionCompactionCompactResult
}

/// <summary>RPC data type for SessionCompactionCompact operations.</summary>
[Experimental(Diagnostics.Experimental)]
internal class SessionCompactionCompactRequest
{
/// <summary>Target session identifier.</summary>
Expand Down Expand Up @@ -1000,6 +1020,7 @@ public async Task<SessionWorkspaceCreateFileResult> CreateFileAsync(string path,
}

/// <summary>Provides session-scoped Fleet APIs.</summary>
[Experimental(Diagnostics.Experimental)]
public class FleetApi
{
private readonly JsonRpc _rpc;
Expand All @@ -1020,6 +1041,7 @@ public async Task<SessionFleetStartResult> StartAsync(string? prompt = null, Can
}

/// <summary>Provides session-scoped Agent APIs.</summary>
[Experimental(Diagnostics.Experimental)]
public class AgentApi
{
private readonly JsonRpc _rpc;
Expand Down Expand Up @@ -1061,6 +1083,7 @@ public async Task<SessionAgentDeselectResult> DeselectAsync(CancellationToken ca
}

/// <summary>Provides session-scoped Compaction APIs.</summary>
[Experimental(Diagnostics.Experimental)]
public class CompactionApi
{
private readonly JsonRpc _rpc;
Expand Down
4 changes: 4 additions & 0 deletions dotnet/src/GitHub.Copilot.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);GHCP001</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(CI)' == 'true' or '$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions dotnet/test/GitHub.Copilot.SDK.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);GHCP001</NoWarn>
</PropertyGroup>

<PropertyGroup>
Expand Down
23 changes: 20 additions & 3 deletions go/rpc/generated_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,19 @@ type SessionWorkspaceCreateFileParams struct {
Path string `json:"path"`
}

// Experimental: SessionFleetStartResult is part of an experimental API and may change or be removed.
type SessionFleetStartResult struct {
// Whether fleet mode was successfully activated
Started bool `json:"started"`
}

// Experimental: SessionFleetStartParams is part of an experimental API and may change or be removed.
type SessionFleetStartParams struct {
// Optional user prompt to combine with fleet instructions
Prompt *string `json:"prompt,omitempty"`
}

// Experimental: SessionAgentListResult is part of an experimental API and may change or be removed.
type SessionAgentListResult struct {
// Available custom agents
Agents []AgentElement `json:"agents"`
Expand All @@ -232,6 +235,7 @@ type AgentElement struct {
Name string `json:"name"`
}

// Experimental: SessionAgentGetCurrentResult is part of an experimental API and may change or be removed.
type SessionAgentGetCurrentResult struct {
// Currently selected custom agent, or null if using the default agent
Agent *SessionAgentGetCurrentResultAgent `json:"agent"`
Expand All @@ -246,6 +250,7 @@ type SessionAgentGetCurrentResultAgent struct {
Name string `json:"name"`
}

// Experimental: SessionAgentSelectResult is part of an experimental API and may change or be removed.
type SessionAgentSelectResult struct {
// The newly selected custom agent
Agent SessionAgentSelectResultAgent `json:"agent"`
Expand All @@ -261,14 +266,17 @@ type SessionAgentSelectResultAgent struct {
Name string `json:"name"`
}

// Experimental: SessionAgentSelectParams is part of an experimental API and may change or be removed.
type SessionAgentSelectParams struct {
// Name of the custom agent to select
Name string `json:"name"`
}

// Experimental: SessionAgentDeselectResult is part of an experimental API and may change or be removed.
type SessionAgentDeselectResult struct {
}

// Experimental: SessionCompactionCompactResult is part of an experimental API and may change or be removed.
type SessionCompactionCompactResult struct {
// Number of messages removed during compaction
MessagesRemoved float64 `json:"messagesRemoved"`
Expand Down Expand Up @@ -402,7 +410,9 @@ type ResultUnion struct {
String *string
}

type ServerModelsRpcApi struct{ client *jsonrpc2.Client }
type ServerModelsRpcApi struct {
client *jsonrpc2.Client
}

func (a *ServerModelsRpcApi) List(ctx context.Context) (*ModelsListResult, error) {
raw, err := a.client.Request("models.list", map[string]interface{}{})
Expand All @@ -416,7 +426,9 @@ func (a *ServerModelsRpcApi) List(ctx context.Context) (*ModelsListResult, error
return &result, nil
}

type ServerToolsRpcApi struct{ client *jsonrpc2.Client }
type ServerToolsRpcApi struct {
client *jsonrpc2.Client
}

func (a *ServerToolsRpcApi) List(ctx context.Context, params *ToolsListParams) (*ToolsListResult, error) {
raw, err := a.client.Request("tools.list", params)
Expand All @@ -430,7 +442,9 @@ func (a *ServerToolsRpcApi) List(ctx context.Context, params *ToolsListParams) (
return &result, nil
}

type ServerAccountRpcApi struct{ client *jsonrpc2.Client }
type ServerAccountRpcApi struct {
client *jsonrpc2.Client
}

func (a *ServerAccountRpcApi) GetQuota(ctx context.Context) (*AccountGetQuotaResult, error) {
raw, err := a.client.Request("account.getQuota", map[string]interface{}{})
Expand Down Expand Up @@ -641,6 +655,7 @@ func (a *WorkspaceRpcApi) CreateFile(ctx context.Context, params *SessionWorkspa
return &result, nil
}

// Experimental: FleetRpcApi contains experimental APIs that may change or be removed.
type FleetRpcApi struct {
client *jsonrpc2.Client
sessionID string
Expand All @@ -664,6 +679,7 @@ func (a *FleetRpcApi) Start(ctx context.Context, params *SessionFleetStartParams
return &result, nil
}

// Experimental: AgentRpcApi contains experimental APIs that may change or be removed.
type AgentRpcApi struct {
client *jsonrpc2.Client
sessionID string
Expand Down Expand Up @@ -724,6 +740,7 @@ func (a *AgentRpcApi) Deselect(ctx context.Context) (*SessionAgentDeselectResult
return &result, nil
}

// Experimental: CompactionRpcApi contains experimental APIs that may change or be removed.
type CompactionRpcApi struct {
client *jsonrpc2.Client
sessionID string
Expand Down
15 changes: 15 additions & 0 deletions nodejs/src/generated/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,15 @@ export interface SessionWorkspaceCreateFileParams {
content: string;
}

/** @experimental */
export interface SessionFleetStartResult {
/**
* Whether fleet mode was successfully activated
*/
started: boolean;
}

/** @experimental */
export interface SessionFleetStartParams {
/**
* Target session identifier
Expand All @@ -358,6 +360,7 @@ export interface SessionFleetStartParams {
prompt?: string;
}

/** @experimental */
export interface SessionAgentListResult {
/**
* Available custom agents
Expand All @@ -378,13 +381,15 @@ export interface SessionAgentListResult {
}[];
}

/** @experimental */
export interface SessionAgentListParams {
/**
* Target session identifier
*/
sessionId: string;
}

/** @experimental */
export interface SessionAgentGetCurrentResult {
/**
* Currently selected custom agent, or null if using the default agent
Expand All @@ -405,13 +410,15 @@ export interface SessionAgentGetCurrentResult {
} | null;
}

/** @experimental */
export interface SessionAgentGetCurrentParams {
/**
* Target session identifier
*/
sessionId: string;
}

/** @experimental */
export interface SessionAgentSelectResult {
/**
* The newly selected custom agent
Expand All @@ -432,6 +439,7 @@ export interface SessionAgentSelectResult {
};
}

/** @experimental */
export interface SessionAgentSelectParams {
/**
* Target session identifier
Expand All @@ -443,15 +451,18 @@ export interface SessionAgentSelectParams {
name: string;
}

/** @experimental */
export interface SessionAgentDeselectResult {}

/** @experimental */
export interface SessionAgentDeselectParams {
/**
* Target session identifier
*/
sessionId: string;
}

/** @experimental */
export interface SessionCompactionCompactResult {
/**
* Whether compaction completed successfully
Expand All @@ -467,6 +478,7 @@ export interface SessionCompactionCompactResult {
messagesRemoved: number;
}

/** @experimental */
export interface SessionCompactionCompactParams {
/**
* Target session identifier
Expand Down Expand Up @@ -660,10 +672,12 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
createFile: async (params: Omit<SessionWorkspaceCreateFileParams, "sessionId">): Promise<SessionWorkspaceCreateFileResult> =>
connection.sendRequest("session.workspace.createFile", { sessionId, ...params }),
},
/** @experimental */
fleet: {
start: async (params: Omit<SessionFleetStartParams, "sessionId">): Promise<SessionFleetStartResult> =>
connection.sendRequest("session.fleet.start", { sessionId, ...params }),
},
/** @experimental */
agent: {
list: async (): Promise<SessionAgentListResult> =>
connection.sendRequest("session.agent.list", { sessionId }),
Expand All @@ -674,6 +688,7 @@ export function createSessionRpc(connection: MessageConnection, sessionId: strin
deselect: async (): Promise<SessionAgentDeselectResult> =>
connection.sendRequest("session.agent.deselect", { sessionId }),
},
/** @experimental */
compaction: {
compact: async (): Promise<SessionCompactionCompactResult> =>
connection.sendRequest("session.compaction.compact", { sessionId }),
Expand Down
Loading
Loading