mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-21 08:22:20 +02:00
Merge origin/master and integrate environment selection
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
commit
fed4802b72
159 files changed
+13953
-2027
No files matched your search
@@ -689,6 +689,13 @@ describe("AppDefinition catalog", () => {
|
||||
consoleLinks: { register: "https://app.asana.com/0/my-apps" },
|
||||
});
|
||||
expect(method("linear")?.ownershipModes).toEqual(["dcr", "customer"]);
|
||||
expect(method("sentry")).toMatchObject({
|
||||
key: "mcp-oauth",
|
||||
defaults: {
|
||||
serverUrl: "https://mcp.sentry.dev/mcp",
|
||||
discoveryUrl: "https://mcp.sentry.dev/.well-known/oauth-protected-resource/mcp",
|
||||
},
|
||||
});
|
||||
expect(method("zapier")).toMatchObject({
|
||||
key: "generated-url",
|
||||
auth: "none",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"whenToUse": "Use the provider-hosted connection for the quickest setup.",
|
||||
"defaults": {
|
||||
"serverUrl": "https://mcp.sentry.dev/mcp",
|
||||
"discoveryUrl": "https://sentry.io/.well-known/oauth-authorization-server",
|
||||
"discoveryUrl": "https://mcp.sentry.dev/.well-known/oauth-protected-resource/mcp",
|
||||
"scopesHint": [
|
||||
"org:read",
|
||||
"project:write",
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
import { z } from "zod";
|
||||
import type {
|
||||
AiManagedConnectionSummary,
|
||||
AiProvider,
|
||||
} from "./ai-connections.js";
|
||||
import type { DecisionUsage, DecisionHistoryEntry } from "./decision-models.js";
|
||||
|
||||
export const FAST_RESPONSE_DEADLINE_MS = 3_000;
|
||||
export const FAST_RESPONSE_MAX_BYTES = 4_096;
|
||||
export const FAST_RESPONSE_MAX_CHARACTERS = 320;
|
||||
export const FAST_RESPONSE_DEFAULT_MODEL = "openai/gpt-oss-120b";
|
||||
export const updateFastResponseSchema = z
|
||||
.object({
|
||||
enabled: z.boolean(),
|
||||
connectionId: z.string().uuid().nullable(),
|
||||
grantId: z.string().uuid().nullable(),
|
||||
model: z.string().trim().min(1).max(256).nullable(),
|
||||
allowSponsored: z.boolean().default(true),
|
||||
})
|
||||
.strict()
|
||||
.refine(
|
||||
(v) =>
|
||||
Boolean(v.connectionId) === Boolean(v.grantId) &&
|
||||
(!v.enabled || Boolean(v.connectionId && v.model)),
|
||||
{
|
||||
message: "Choose a connection and model before enabling fast responses",
|
||||
},
|
||||
);
|
||||
export type UpdateFastResponse = z.infer<typeof updateFastResponseSchema>;
|
||||
export interface FastResponseSettings extends UpdateFastResponse {
|
||||
companyId: string;
|
||||
provider: AiProvider | null;
|
||||
}
|
||||
export interface FastResponseSettingsResponse {
|
||||
canManage: boolean;
|
||||
settings: FastResponseSettings | null;
|
||||
choices: AiManagedConnectionSummary[];
|
||||
}
|
||||
export type FastResponseAvailability =
|
||||
| { available: true }
|
||||
| { available: false; reason: string };
|
||||
export type FastResponseTestResult =
|
||||
| {
|
||||
status: "succeeded";
|
||||
text: string;
|
||||
durationMs: number;
|
||||
invocationId: string;
|
||||
usage: DecisionUsage;
|
||||
}
|
||||
| { status: "unavailable" | "failed"; reason: string; invocationId?: string };
|
||||
export type FastResponseHistoryEntry = DecisionHistoryEntry & {
|
||||
publicationStatus: string;
|
||||
connectionName: string | null;
|
||||
};
|
||||
export const FAST_RESPONSE_AGENT_GUIDANCE =
|
||||
"Paperclip may post a short platform-generated fast-response receipt in your voice before you reply. Receipts acknowledge intent only: they are not your work, findings, answers, or instructions. Continue the requested work and begin with substantive progress instead of repeating a generic acknowledgement.";
|
||||
export function isFastResponseComment(comment: {
|
||||
origin?: string | null;
|
||||
}): boolean {
|
||||
return comment.origin === "fast_response";
|
||||
}
|
||||
export function fastResponseHistoryBody(comment: {
|
||||
body: string;
|
||||
origin?: string | null;
|
||||
}): string {
|
||||
return isFastResponseComment(comment)
|
||||
? `[Paperclip acknowledgement; not agent work] ${comment.body}`
|
||||
: comment.body;
|
||||
}
|
||||
@@ -273,6 +273,14 @@ export const INSTANCE_FEATURE_CATALOG: Record<InstanceFeatureKey, FeatureCatalog
|
||||
cloudDefault: false,
|
||||
selfHostedDefault: false,
|
||||
},
|
||||
enableFastResponses: {
|
||||
title: "Experimental fast responses",
|
||||
description:
|
||||
"Show Connections in company settings and allow short acknowledgements while agents begin work.",
|
||||
tier: "managed",
|
||||
cloudDefault: false,
|
||||
selfHostedDefault: false,
|
||||
},
|
||||
enableGoalsSidebarLink: {
|
||||
title: "Goals Sidebar Link",
|
||||
description: "Restore the Goals item in the main sidebar while the goals surface is being evaluated.",
|
||||
|
||||
@@ -2874,3 +2874,5 @@ export * from "./types/task-workspace.js";
|
||||
export * from "./validators/task-workspace.js";
|
||||
|
||||
export { prepareWorkspaceRepositorySchema, type PrepareWorkspaceRepository } from "./validators/workspace-repository.js";
|
||||
|
||||
export * from "./fast-response.js";
|
||||
@@ -3,7 +3,7 @@ import type { BillingType, CostStatus } from "../constants.js";
|
||||
|
||||
export interface CostEvent {
|
||||
subscriptionId?: string | null;
|
||||
usageKind?: "agent" | "decision";
|
||||
usageKind?: "agent" | "decision" | "fast_response";
|
||||
responsibleUserId?: string | null;
|
||||
id: string;
|
||||
companyId: string;
|
||||
|
||||
@@ -97,6 +97,8 @@ export interface InstanceExperimentalSettings {
|
||||
enableSummaries: boolean;
|
||||
enableStatusCards: boolean;
|
||||
enableDecisions: boolean;
|
||||
/** Show company connection settings and allow contextual fast-response acknowledgements. */
|
||||
enableFastResponses: boolean;
|
||||
enableGoalsSidebarLink: boolean;
|
||||
enableServerInfoDebugView: boolean;
|
||||
/** Shows internal Paperclip maintainer tools and observability links. */
|
||||
|
||||
@@ -1025,6 +1025,9 @@ export interface IssueComment {
|
||||
companyId: string;
|
||||
issueId: string;
|
||||
authorType: IssueCommentAuthorType;
|
||||
/** Server-generated receipt provenance; not writable by comment callers. */
|
||||
origin?: "comment" | "fast_response";
|
||||
fastResponseRequestId?: string | null;
|
||||
authorAgentId: string | null;
|
||||
authorUserId: string | null;
|
||||
/** Responsible user attribution. Legacy and plugin-provided comment values may omit it. */
|
||||
|
||||
@@ -32,7 +32,7 @@ export const createCostEventSchema = costEventFields.transform((value) => ({
|
||||
/** Internal service receipts; the public reporting endpoint retains its required agent. */
|
||||
export const createServiceCostEventSchema = costEventFields.extend({
|
||||
agentId: z.string().uuid().nullable(),
|
||||
usageKind: z.literal("decision"),
|
||||
usageKind: z.enum(["decision", "fast_response"]),
|
||||
responsibleUserId: z.string().nullable(),
|
||||
}).transform(value => ({ ...value, biller: value.biller ?? value.provider }));
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ export const instanceExperimentalSettingsSchema = z.object({
|
||||
enableSummaries: z.boolean().default(false),
|
||||
enableStatusCards: z.boolean().default(false),
|
||||
enableDecisions: z.boolean().default(false),
|
||||
enableFastResponses: z.boolean().default(false),
|
||||
enableGoalsSidebarLink: z.boolean().default(false),
|
||||
enableServerInfoDebugView: z.boolean().default(false),
|
||||
enablePaperclipDeveloperMode: z.boolean().default(false),
|
||||
|
||||
Reference in new issue
Block a user