@gitterm/sdk 0.7.0 → 0.8.0
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/README.md +2 -0
- package/dist/direct/index.js +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,8 @@ try {
|
|
|
37
37
|
workspace,
|
|
38
38
|
idempotencyKey: "review-pr-42",
|
|
39
39
|
prompt: "Review PR #42 and fix the failing tests.",
|
|
40
|
+
// Optional files for the agent, e.g. a screenshot of the failure.
|
|
41
|
+
attachments: [{ name: "failure.png", mime: "image/png", data: base64Png }],
|
|
40
42
|
});
|
|
41
43
|
const result = await client.runs.result(run);
|
|
42
44
|
console.log(result.finalText);
|
package/dist/direct/index.js
CHANGED
|
@@ -1827,7 +1827,12 @@ function createV2Runtime(target) {
|
|
|
1827
1827
|
},
|
|
1828
1828
|
async prompt(input) {
|
|
1829
1829
|
await switchSessionOptions(input.sessionId, input.agent, input.model);
|
|
1830
|
-
await call(client.session.prompt({
|
|
1830
|
+
await call(client.session.prompt({
|
|
1831
|
+
sessionID: input.sessionId,
|
|
1832
|
+
id: input.messageId,
|
|
1833
|
+
text: input.prompt,
|
|
1834
|
+
files: input.files
|
|
1835
|
+
}, options()));
|
|
1831
1836
|
},
|
|
1832
1837
|
async abort(sessionID) {
|
|
1833
1838
|
await call(client.session.interrupt({ sessionID }, options()));
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export type { DeviceCodeInfo, LoginWithDeviceCodeOptions } from "./device-login.
|
|
|
6
6
|
export { AgentRunError, GittermError, WorkspaceLifecycleError } from "./errors.js";
|
|
7
7
|
export { createGittermWorkspaceClient, getWorkspaceEnvironment, type GittermWorkspaceClient, type WorkspaceClientOptions, type WorkspaceEnvironment, type WorkspacePort, type WorkspacePortVisibility, type WorkspaceSelf, } from "./workspace-client.js";
|
|
8
8
|
export type { CredentialErrorCode, GittermErrorCode, WorkspaceLifecycleErrorCode, } from "./errors.js";
|
|
9
|
-
export type { AgentPermissionRequest, AgentQuestion, AgentQuestionOption, AgentQuestionRequest, AgentRun, AgentRunCreateInput, AgentRunInputRequest, AgentRunMessage, AgentRunMessagePart, AgentRunReply, AgentRunStatus, AgentRunEvent, AgentRunResult, AgentRunReplyPermission, AgentRunReplyQuestion, RunResultOptions, RunRef, RunWaitOptions, RunWatchOptions, AgentType, AgentKey, AuthStatus, BuiltInAgentKey, CloudProvider, ProviderKey, Workspace, WorkspaceCreateInput, WorkspaceCreateResult, WorkspaceCatalog, WorkspaceEnsureRunningResult, WorkspaceHostingType, WorkspaceListOptions, WorkspaceListResult, WorkspaceRestartResult, WorkspaceRuntimeAccess, WorkspaceStatus, WorkspaceSetupStatus, ModelCredential, ModelProviderInfo, ModelCredentialSource, WorkspaceModelsInput, WorkspaceModelAccess, WorkspacePauseResult, WorkspaceTerminateResult, WorkspaceProviderSelection, Integration, IntegrationKey, IntegrationCategory, Connection, ConnectionKind, ConnectionStatus, ConnectionDetails, GitHubConnectionDetails, GoogleConnectionDetails, CreateConnectionInput, CreateConnectionResult, GitHubRepository, GitHubBranch, GoogleSetup, } from "./types.js";
|
|
9
|
+
export type { AgentPermissionRequest, AgentQuestion, AgentQuestionOption, AgentQuestionRequest, AgentRun, AgentRunAttachment, AgentRunCreateInput, AgentRunInputRequest, AgentRunMessage, AgentRunMessagePart, AgentRunReply, AgentRunStatus, AgentRunEvent, AgentRunResult, AgentRunReplyPermission, AgentRunReplyQuestion, RunResultOptions, RunRef, RunWaitOptions, RunWatchOptions, AgentType, AgentKey, AuthStatus, BuiltInAgentKey, CloudProvider, ProviderKey, Workspace, WorkspaceCreateInput, WorkspaceCreateResult, WorkspaceCatalog, WorkspaceEnsureRunningResult, WorkspaceHostingType, WorkspaceListOptions, WorkspaceListResult, WorkspaceRestartResult, WorkspaceRuntimeAccess, WorkspaceStatus, WorkspaceSetupStatus, ModelCredential, ModelProviderInfo, ModelCredentialSource, WorkspaceModelsInput, WorkspaceModelAccess, WorkspacePauseResult, WorkspaceTerminateResult, WorkspaceProviderSelection, Integration, IntegrationKey, IntegrationCategory, Connection, ConnectionKind, ConnectionStatus, ConnectionDetails, GitHubConnectionDetails, GoogleConnectionDetails, CreateConnectionInput, CreateConnectionResult, GitHubRepository, GitHubBranch, GoogleSetup, } from "./types.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -479,6 +479,14 @@ export type AgentRunListResult = {
|
|
|
479
479
|
hasMore: boolean;
|
|
480
480
|
};
|
|
481
481
|
};
|
|
482
|
+
export type AgentRunAttachment = {
|
|
483
|
+
/** Shown to the agent so the prompt can refer to the file by name. */
|
|
484
|
+
name?: string;
|
|
485
|
+
/** e.g. `image/png`. */
|
|
486
|
+
mime: string;
|
|
487
|
+
/** Base64-encoded content. */
|
|
488
|
+
data: string;
|
|
489
|
+
};
|
|
482
490
|
export type AgentRunCreateInput = {
|
|
483
491
|
workspace: WorkspaceRef;
|
|
484
492
|
/**
|
|
@@ -488,6 +496,11 @@ export type AgentRunCreateInput = {
|
|
|
488
496
|
*/
|
|
489
497
|
idempotencyKey?: string;
|
|
490
498
|
prompt: string;
|
|
499
|
+
/**
|
|
500
|
+
* Files the agent receives together with the prompt, e.g. screenshots for a vision model.
|
|
501
|
+
* At most 10 per run and 20 MB of base64 in total.
|
|
502
|
+
*/
|
|
503
|
+
attachments?: AgentRunAttachment[];
|
|
491
504
|
title?: string;
|
|
492
505
|
agent?: string;
|
|
493
506
|
/** OpenCode model in provider/model format. */
|