mastracode 0.22.0 → 0.22.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/CHANGELOG.md +18 -0
- package/dist/HarnessCompat.d.ts +2 -21
- package/dist/HarnessCompat.d.ts.map +1 -1
- package/dist/{chunk-B4IKAUT7.cjs → chunk-AG4CK4AA.cjs} +27 -4
- package/dist/chunk-AG4CK4AA.cjs.map +1 -0
- package/dist/{chunk-DFC5V3P7.cjs → chunk-G2TNUR63.cjs} +30 -93
- package/dist/chunk-G2TNUR63.cjs.map +1 -0
- package/dist/{chunk-BFO3NTQO.js → chunk-G6T5S552.js} +27 -4
- package/dist/chunk-G6T5S552.js.map +1 -0
- package/dist/{chunk-Y5AUV6T3.js → chunk-G76EJQC6.js} +30 -93
- package/dist/chunk-G76EJQC6.js.map +1 -0
- package/dist/cli.cjs +8 -8
- package/dist/cli.js +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/schema.d.ts +4 -7
- package/dist/schema.d.ts.map +1 -1
- package/dist/tui/commands/github.d.ts +14 -0
- package/dist/tui/commands/github.d.ts.map +1 -1
- package/dist/tui/handlers/agent-lifecycle.d.ts.map +1 -1
- package/dist/tui.cjs +11 -11
- package/dist/tui.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-B4IKAUT7.cjs.map +0 -1
- package/dist/chunk-BFO3NTQO.js.map +0 -1
- package/dist/chunk-DFC5V3P7.cjs.map +0 -1
- package/dist/chunk-Y5AUV6T3.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.22.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Auto-subscribe to the current branch's PR via GitHub Signals at the end of each agent run. When experimental GitHub Signals are enabled in /settings and the checked-out branch has an open PR, the thread is automatically subscribed (once per thread, fire-and-forget). ([#17538](https://github.com/mastra-ai/mastra/pull/17538))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`ae1fa3a`](https://github.com/mastra-ai/mastra/commit/ae1fa3a9c40510f1e068ffc2345cf09f9ee32b26)]:
|
|
10
|
+
- @mastra/core@1.40.0
|
|
11
|
+
|
|
12
|
+
## 0.22.1-alpha.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Auto-subscribe to the current branch's PR via GitHub Signals at the end of each agent run. When experimental GitHub Signals are enabled in /settings and the checked-out branch has an open PR, the thread is automatically subscribed (once per thread, fire-and-forget). ([#17538](https://github.com/mastra-ai/mastra/pull/17538))
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`ae1fa3a`](https://github.com/mastra-ai/mastra/commit/ae1fa3a9c40510f1e068ffc2345cf09f9ee32b26)]:
|
|
19
|
+
- @mastra/core@1.40.0-alpha.0
|
|
20
|
+
|
|
3
21
|
## 0.22.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/HarnessCompat.d.ts
CHANGED
|
@@ -14,16 +14,7 @@ type CloneSessionOptions = {
|
|
|
14
14
|
export declare function v1ModeToLegacy<TState = {}>(mode: HarnessMode, agent: Agent): HarnessModeLegacy<TState>;
|
|
15
15
|
export declare class HarnessCompat<TState = {}> extends HarnessLegacy<TState> {
|
|
16
16
|
#private;
|
|
17
|
-
constructor(args: HarnessConfig<TState>, harnessV1: Harness<HarnessMode[]
|
|
18
|
-
getState(): Readonly<TState>;
|
|
19
|
-
setState(updates: Partial<TState>): Promise<void>;
|
|
20
|
-
getSubagentModelId({ agentType }?: {
|
|
21
|
-
agentType?: string;
|
|
22
|
-
}): string | null;
|
|
23
|
-
setSubagentModelId({ modelId, agentType }: {
|
|
24
|
-
modelId: string;
|
|
25
|
-
agentType?: string;
|
|
26
|
-
}): Promise<void>;
|
|
17
|
+
constructor(args: HarnessConfig<TState>, harnessV1: Harness<HarnessMode[]>);
|
|
27
18
|
switchThread({ threadId }: {
|
|
28
19
|
threadId: string;
|
|
29
20
|
}): Promise<void>;
|
|
@@ -31,7 +22,7 @@ export declare class HarnessCompat<TState = {}> extends HarnessLegacy<TState> {
|
|
|
31
22
|
allResources?: boolean;
|
|
32
23
|
includeForkedSubagents?: boolean;
|
|
33
24
|
}): Promise<HarnessThread[]>;
|
|
34
|
-
cloneSession(opts?: CloneSessionOptions): Promise<Session
|
|
25
|
+
cloneSession(opts?: CloneSessionOptions): Promise<Session>;
|
|
35
26
|
cloneThread({ sourceThreadId, title, resourceId, }?: {
|
|
36
27
|
sourceThreadId?: string;
|
|
37
28
|
title?: string;
|
|
@@ -45,16 +36,6 @@ export declare class HarnessCompat<TState = {}> extends HarnessLegacy<TState> {
|
|
|
45
36
|
switchMode({ modeId }: {
|
|
46
37
|
modeId: string;
|
|
47
38
|
}): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Activate a skill on the current v1 session.
|
|
50
|
-
*
|
|
51
|
-
* Pass-through to `Session.useSkill` — returns the resolved instructions
|
|
52
|
-
* string, or throws `HarnessSkillNotFoundError` if the skill is missing.
|
|
53
|
-
* Throws if there is no active session.
|
|
54
|
-
*/
|
|
55
|
-
useSkill(name: string, opts?: {
|
|
56
|
-
args?: Record<string, unknown>;
|
|
57
|
-
}): Promise<string>;
|
|
58
39
|
}
|
|
59
40
|
export {};
|
|
60
41
|
//# sourceMappingURL=HarnessCompat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HarnessCompat.d.ts","sourceRoot":"","sources":["../src/HarnessCompat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,IAAI,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC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C,MAAM,GAAG,EAAE,CAAE,SAAQ,aAAa,CAAC,MAAM,CAAC;;gBAIvD,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAMpE,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB/D,WAAW,CAAC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA4C7G,YAAY,CAAC,IAAI,GAAE,mBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IAS9D,WAAW,CAAC,EAChB,cAAc,EACd,KAAK,EACL,UAAU,GACX,GAAE;QACD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,aAAa,CAAC;IAiC/B,cAAc,IAAI,iBAAiB,CAAC,MAAM,CAAC;IAc3C;;;OAGG;IACG,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAYhE"}
|
|
@@ -1201,7 +1201,7 @@ function getInstallCommand(pm, version) {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
function getCurrentVersion() {
|
|
1203
1203
|
{
|
|
1204
|
-
return "0.22.
|
|
1204
|
+
return "0.22.1";
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
1207
|
async function fetchLatestVersion() {
|
|
@@ -14669,7 +14669,7 @@ function parseGithubPRReference(input) {
|
|
|
14669
14669
|
return void 0;
|
|
14670
14670
|
}
|
|
14671
14671
|
async function getCurrentGithubThread(ctx) {
|
|
14672
|
-
const harness = ctx.harness;
|
|
14672
|
+
const harness = ctx.state.harness;
|
|
14673
14673
|
const threadId = harness.getCurrentThreadId?.();
|
|
14674
14674
|
if (!threadId) return {};
|
|
14675
14675
|
const thread = (await harness.listThreads?.({ allResources: true }))?.find((item) => item.id === threadId);
|
|
@@ -14753,6 +14753,21 @@ async function detectCurrentPullRequest(ctx) {
|
|
|
14753
14753
|
);
|
|
14754
14754
|
});
|
|
14755
14755
|
}
|
|
14756
|
+
async function tryAutoSubscribeToBranchPR(ctx) {
|
|
14757
|
+
if (!chunkEAUXUMEB_cjs.loadSettings().signals.experimentalGithubSignals) return;
|
|
14758
|
+
const githubSignalsProcessor = ctx.state.options?.githubSignals;
|
|
14759
|
+
if (!githubSignalsProcessor?.subscribeThreadToPR) return;
|
|
14760
|
+
const { threadId, resourceId } = await getCurrentGithubThread(ctx);
|
|
14761
|
+
if (!threadId || !resourceId) return;
|
|
14762
|
+
const currentPR = await detectCurrentPullRequest(ctx);
|
|
14763
|
+
const pr = currentPR ? parseGithubPRReference(currentPR) : void 0;
|
|
14764
|
+
if (!pr) return;
|
|
14765
|
+
try {
|
|
14766
|
+
const result = await githubSignalsProcessor.subscribeThreadToPR({ threadId, resourceId, pr });
|
|
14767
|
+
ctx.showInfo(`Auto-subscribed to ${result.owner}/${result.repo}#${result.number} via GitHub Signals.`);
|
|
14768
|
+
} catch {
|
|
14769
|
+
}
|
|
14770
|
+
}
|
|
14756
14771
|
async function handleGithubCommand(ctx, args = []) {
|
|
14757
14772
|
if (!chunkEAUXUMEB_cjs.loadSettings().signals.experimentalGithubSignals) {
|
|
14758
14773
|
ctx.showError("Experimental GitHub signals are disabled. Enable them in /settings and restart MastraCode.");
|
|
@@ -15115,6 +15130,7 @@ function pruneChatContainer(state) {
|
|
|
15115
15130
|
}
|
|
15116
15131
|
|
|
15117
15132
|
// src/tui/handlers/agent-lifecycle.ts
|
|
15133
|
+
var autoSubscribeCheckedThreads = /* @__PURE__ */ new Set();
|
|
15118
15134
|
function handleAgentStart(ctx) {
|
|
15119
15135
|
const { state } = ctx;
|
|
15120
15136
|
state.goalManager.startActiveTimer();
|
|
@@ -15142,6 +15158,13 @@ function handleAgentEnd(ctx) {
|
|
|
15142
15158
|
ctx.updateStatusLine();
|
|
15143
15159
|
}
|
|
15144
15160
|
});
|
|
15161
|
+
const harness = state.harness;
|
|
15162
|
+
const threadId = harness.getCurrentThreadId?.();
|
|
15163
|
+
if (threadId && !autoSubscribeCheckedThreads.has(threadId)) {
|
|
15164
|
+
autoSubscribeCheckedThreads.add(threadId);
|
|
15165
|
+
tryAutoSubscribeToBranchPR(ctx).catch(() => {
|
|
15166
|
+
});
|
|
15167
|
+
}
|
|
15145
15168
|
if (state.streamingComponent) {
|
|
15146
15169
|
state.streamingComponent = void 0;
|
|
15147
15170
|
state.streamingMessage = void 0;
|
|
@@ -19382,5 +19405,5 @@ exports.createTUIState = createTUIState;
|
|
|
19382
19405
|
exports.detectTerminalTheme = detectTerminalTheme;
|
|
19383
19406
|
exports.formatOMStatus = formatOMStatus;
|
|
19384
19407
|
exports.getCurrentVersion = getCurrentVersion;
|
|
19385
|
-
//# sourceMappingURL=chunk-
|
|
19386
|
-
//# sourceMappingURL=chunk-
|
|
19408
|
+
//# sourceMappingURL=chunk-AG4CK4AA.cjs.map
|
|
19409
|
+
//# sourceMappingURL=chunk-AG4CK4AA.cjs.map
|