@opentag/core 0.3.0 → 0.3.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.
- package/dist/action.d.ts +24 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/capability.d.ts +19 -0
- package/dist/capability.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +556 -2
- package/dist/index.js.map +1 -1
- package/dist/presentation.d.ts +2968 -0
- package/dist/presentation.d.ts.map +1 -0
- package/dist/request-body.d.ts +21 -0
- package/dist/request-body.d.ts.map +1 -0
- package/dist/schema.d.ts +20 -20
- package/dist/schema.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/action.d.ts
CHANGED
|
@@ -30,7 +30,31 @@ export type SuggestedActionCandidate = {
|
|
|
30
30
|
proposalPreconditions?: string[];
|
|
31
31
|
intent: MutationIntent;
|
|
32
32
|
};
|
|
33
|
+
export type ActionReceiptState = "ready_to_apply" | "needs_approval" | "needs_setup" | "unsupported";
|
|
34
|
+
export type ActionReceiptDecision = "apply" | "approve" | "reject" | "continue";
|
|
35
|
+
export type ActionReceiptPrimaryDecision = "apply" | "continue" | "none";
|
|
36
|
+
export type ActionReceiptCapability = {
|
|
37
|
+
state?: ActionReceiptState;
|
|
38
|
+
targetLabel?: string;
|
|
39
|
+
setupReason?: string;
|
|
40
|
+
visibleDecisions?: ActionReceiptDecision[];
|
|
41
|
+
primaryDecision?: ActionReceiptPrimaryDecision;
|
|
42
|
+
};
|
|
43
|
+
export type ActionReceiptContext = {
|
|
44
|
+
capabilityByIntentId?: Record<string, ActionReceiptCapability>;
|
|
45
|
+
};
|
|
46
|
+
export type ActionReceipt = {
|
|
47
|
+
candidate: SuggestedActionCandidate;
|
|
48
|
+
state: ActionReceiptState;
|
|
49
|
+
targetLabel: string;
|
|
50
|
+
setupReason?: string;
|
|
51
|
+
visibleDecisions: ActionReceiptDecision[];
|
|
52
|
+
primaryDecision: ActionReceiptPrimaryDecision;
|
|
53
|
+
};
|
|
33
54
|
export declare function parseThreadActionCommand(rawText: string): ThreadActionCommand | null;
|
|
34
55
|
export declare function suggestedActionCandidatesFromSnapshots(snapshots: SuggestedChangesSnapshot[], startIndex?: number): SuggestedActionCandidate[];
|
|
35
56
|
export declare function suggestedActionCandidatesFromResult(result: OpenTagRunResult): SuggestedActionCandidate[];
|
|
57
|
+
export declare function actionReceiptHeading(receipts: ActionReceipt[]): string;
|
|
58
|
+
export declare function buildActionReceipt(candidate: SuggestedActionCandidate, context?: ActionReceiptContext): ActionReceipt;
|
|
59
|
+
export declare function buildActionReceiptsFromResult(result: OpenTagRunResult, context?: ActionReceiptContext): ActionReceipt[];
|
|
36
60
|
//# sourceMappingURL=action.d.ts.map
|
package/dist/action.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE9F,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE3E,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAClB;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,gBAAg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AAC;AAoFF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,GAAG,IAAI,CAgCpF;AAED,wBAAgB,sCAAsC,CACpD,SAAS,EAAE,wBAAwB,EAAE,EACrC,UAAU,SAAI,GACb,wBAAwB,EAAE,CAgB5B;AAED,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,gBAAgB,GAAG,wBAAwB,EAAE,CAExG;AAyBD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAOtE;AA0BD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,wBAAwB,EAAE,OAAO,GAAE,oBAAyB,GAAG,aAAa,CAWzH;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAE,oBAAyB,GAAG,aAAa,EAAE,CAE3H"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type OpenTagPlatformId = "github" | "gitlab" | "slack" | "lark" | "telegram";
|
|
2
|
+
export type PlatformLivenessStrategy = "source_receipt" | "status_update" | "thread_reply" | "pull_status";
|
|
3
|
+
export type PlatformCapabilityDescriptor = {
|
|
4
|
+
id: OpenTagPlatformId;
|
|
5
|
+
receivesEvents: boolean;
|
|
6
|
+
repliesToSourceThread: boolean;
|
|
7
|
+
supportsStatusUpdates: boolean;
|
|
8
|
+
supportsRichPresentation: boolean;
|
|
9
|
+
supportsActionReplies: boolean;
|
|
10
|
+
requiresExplicitAddressing: boolean;
|
|
11
|
+
livenessStrategy: PlatformLivenessStrategy;
|
|
12
|
+
};
|
|
13
|
+
export declare const OPEN_TAG_PLATFORM_CAPABILITIES: Record<OpenTagPlatformId, PlatformCapabilityDescriptor>;
|
|
14
|
+
export declare function isOpenTagPlatformId(value: string): value is OpenTagPlatformId;
|
|
15
|
+
export declare function platformCapabilityForProvider(provider: string): PlatformCapabilityDescriptor | undefined;
|
|
16
|
+
export declare function shouldDeliverCallbackRunStatus(provider: string): boolean;
|
|
17
|
+
export declare function shouldDeliverCallbackProgress(provider: string): boolean;
|
|
18
|
+
export declare function shouldDeliverSourceReceipt(provider: string): boolean;
|
|
19
|
+
//# sourceMappingURL=capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAEpF,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,CAAC;AAE3G,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,EAAE,iBAAiB,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;IAClC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,0BAA0B,EAAE,OAAO,CAAC;IACpC,gBAAgB,EAAE,wBAAwB,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,iBAAiB,EAAE,4BAA4B,CAmDlG,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAE7E;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,4BAA4B,GAAG,SAAS,CAExG;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIxE;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIvE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEpE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export * from "./action.js";
|
|
2
|
+
export * from "./capability.js";
|
|
2
3
|
export * from "./json-schema.js";
|
|
3
4
|
export * from "./mention.js";
|
|
5
|
+
export * from "./presentation.js";
|
|
4
6
|
export * from "./project-target.js";
|
|
5
7
|
export * from "./protocol.js";
|
|
8
|
+
export * from "./request-body.js";
|
|
6
9
|
export * from "./schema.js";
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|