@mastra/factory 0.25.0-alpha.4 → 0.25.0-alpha.5
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/auth.js +1 -2
- package/dist/boards/define-board.js +1 -2
- package/dist/boards/index.js +1 -2
- package/dist/boards/registry.js +1 -2
- package/dist/boards/relocate.js +1 -2
- package/dist/boards/review.js +1 -2
- package/dist/boards/semantics.js +1 -2
- package/dist/boards/transition-policy.js +1 -2
- package/dist/boards/work-tool-rules.js +1 -2
- package/dist/boards/work-transition-policy.js +1 -2
- package/dist/boards/work.js +1 -2
- package/dist/environment/build-runner.js +1 -2
- package/dist/environment/build-schedule.js +1 -2
- package/dist/environment/build-workflow.js +1 -2
- package/dist/environment/build.js +1 -2
- package/dist/environment/heads.js +1 -2
- package/dist/factory.d.ts +4 -2
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +43 -16
- package/dist/factory.js.map +1 -1
- package/dist/feed-events.js +1 -2
- package/dist/index.js +2 -2
- package/dist/integrations/channel-thread-announcements.d.ts +8 -0
- package/dist/integrations/channel-thread-announcements.d.ts.map +1 -0
- package/dist/integrations/channel-thread-announcements.js +16 -0
- package/dist/integrations/channel-thread-announcements.js.map +1 -0
- package/dist/integrations/github/acceptance-labels.js +1 -2
- package/dist/integrations/github/app-identity.js +1 -2
- package/dist/integrations/github/commits.js +1 -2
- package/dist/integrations/github/config.js +1 -2
- package/dist/integrations/github/default-rules.js +2 -3
- package/dist/integrations/github/integration.js +3 -4
- package/dist/integrations/github/issue-reconciler.js +1 -2
- package/dist/integrations/github/pat.js +1 -2
- package/dist/integrations/github/provenance.d.ts.map +1 -1
- package/dist/integrations/github/provenance.js +2 -5
- package/dist/integrations/github/provenance.js.map +1 -1
- package/dist/integrations/github/reconcile-worker.js +1 -2
- package/dist/integrations/github/reconciliation-config.js +1 -2
- package/dist/integrations/github/routes.js +4 -5
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +14 -3
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/github/sandbox-release.js +1 -2
- package/dist/integrations/github/sandbox.js +1 -2
- package/dist/integrations/github/session-subscriptions.js +1 -2
- package/dist/integrations/github/settle-or-abort.js +1 -2
- package/dist/integrations/github/stale-reviews.js +1 -2
- package/dist/integrations/github/subscriptions.js +1 -2
- package/dist/integrations/github/token-refresh.js +1 -2
- package/dist/integrations/github/webhook.d.ts.map +1 -1
- package/dist/integrations/github/webhook.js +17 -3
- package/dist/integrations/github/webhook.js.map +1 -1
- package/dist/integrations/gitlab/agent-tools.js +1 -2
- package/dist/integrations/gitlab/api.js +1 -2
- package/dist/integrations/gitlab/default-rules.js +1 -2
- package/dist/integrations/gitlab/integration.js +2 -3
- package/dist/integrations/gitlab/issue-reconciler.js +1 -2
- package/dist/integrations/gitlab/merge-request-reconciler.js +1 -2
- package/dist/integrations/gitlab/reconciler.js +1 -2
- package/dist/integrations/gitlab/reconciliation-config.js +1 -2
- package/dist/integrations/gitlab/routes.js +1 -2
- package/dist/integrations/gitlab/rules.js +1 -2
- package/dist/integrations/gitlab/session-subscriptions.js +1 -2
- package/dist/integrations/gitlab/subscriptions.js +1 -2
- package/dist/integrations/gitlab/version-control.js +1 -2
- package/dist/integrations/gitlab/webhook-dispatch.js +1 -2
- package/dist/integrations/gitlab/webhook.js +1 -2
- package/dist/integrations/incidentio/agent-tools.js +1 -2
- package/dist/integrations/incidentio/api.js +1 -2
- package/dist/integrations/incidentio/claim.js +1 -2
- package/dist/integrations/incidentio/default-rules.js +1 -2
- package/dist/integrations/incidentio/intake.js +1 -2
- package/dist/integrations/incidentio/integration.js +1 -2
- package/dist/integrations/incidentio/issue-reconciler.js +1 -2
- package/dist/integrations/incidentio/reconciliation-config.js +1 -2
- package/dist/integrations/incidentio/routes.js +1 -2
- package/dist/integrations/incidentio/rules.js +1 -2
- package/dist/integrations/issue-reconcile-worker.js +1 -2
- package/dist/integrations/issue-reconciler.js +1 -2
- package/dist/integrations/jira/adf.js +1 -2
- package/dist/integrations/jira/agent-tools.js +1 -2
- package/dist/integrations/jira/api.js +1 -2
- package/dist/integrations/jira/claim.js +1 -2
- package/dist/integrations/jira/default-rules.js +1 -2
- package/dist/integrations/jira/integration.js +1 -2
- package/dist/integrations/jira/issue-reconciler.js +1 -2
- package/dist/integrations/jira/reconciliation-config.js +1 -2
- package/dist/integrations/jira/routes.js +1 -2
- package/dist/integrations/jira/rules.js +1 -2
- package/dist/integrations/linear/agent-tools.d.ts +1 -1
- package/dist/integrations/linear/agent-tools.d.ts.map +1 -1
- package/dist/integrations/linear/agent-tools.js +5 -5
- package/dist/integrations/linear/agent-tools.js.map +1 -1
- package/dist/integrations/linear/claim.js +1 -2
- package/dist/integrations/linear/default-rules.js +1 -2
- package/dist/integrations/linear/integration.d.ts +2 -0
- package/dist/integrations/linear/integration.d.ts.map +1 -1
- package/dist/integrations/linear/integration.js +2 -2
- package/dist/integrations/linear/integration.js.map +1 -1
- package/dist/integrations/linear/issue-reconciler.js +1 -2
- package/dist/integrations/linear/reconciliation-config.js +1 -2
- package/dist/integrations/linear/routes.js +1 -2
- package/dist/integrations/linear/rules.js +1 -2
- package/dist/integrations/platform/api-client.js +1 -2
- package/dist/integrations/platform/connect/routes.js +1 -2
- package/dist/integrations/platform/github/event-worker.js +6 -2
- package/dist/integrations/platform/github/event-worker.js.map +1 -1
- package/dist/integrations/platform/github/integration.js +1 -2
- package/dist/integrations/platform/gitlab/event-worker.js +1 -2
- package/dist/integrations/platform/gitlab/integration.js +1 -2
- package/dist/integrations/platform/incidentio/integration.js +1 -2
- package/dist/integrations/platform/jira/agent-tools.js +1 -2
- package/dist/integrations/platform/jira/integration.js +1 -2
- package/dist/integrations/platform/jira/routes.js +1 -2
- package/dist/integrations/platform/linear/event-worker.js +1 -2
- package/dist/integrations/platform/linear/integration.d.ts.map +1 -1
- package/dist/integrations/platform/linear/integration.js +2 -2
- package/dist/integrations/platform/linear/integration.js.map +1 -1
- package/dist/integrations/pull-request-head.js +1 -2
- package/dist/integrations/reconciliation-config.js +1 -2
- package/dist/integrations/slack/channel-reply-processor.d.ts.map +1 -1
- package/dist/integrations/slack/channel-reply-processor.js +11 -5
- package/dist/integrations/slack/channel-reply-processor.js.map +1 -1
- package/dist/integrations/slack/channel-session-link-processor.js +1 -2
- package/dist/integrations/slack/connect-route.js +1 -2
- package/dist/integrations/slack/emoji-shortcodes.generated.js +1 -2
- package/dist/integrations/slack/emoji.js +1 -2
- package/dist/integrations/slack/feed-publisher.js +1 -2
- package/dist/integrations/slack/integration.d.ts +5 -0
- package/dist/integrations/slack/integration.d.ts.map +1 -1
- package/dist/integrations/slack/integration.js +13 -2
- package/dist/integrations/slack/integration.js.map +1 -1
- package/dist/integrations/slack/reply-reminder-processor.js +1 -2
- package/dist/integrations/slack/reply-tool.js +1 -2
- package/dist/integrations/slack/share-file-tool.js +1 -2
- package/dist/integrations/slack/slack.js +2 -3
- package/dist/integrations/subscription-session.js +1 -2
- package/dist/integrations/workos/integration.js +1 -2
- package/dist/mcp/disconnect.js +1 -2
- package/dist/mcp/events.js +2 -3
- package/dist/mcp/routes.js +1 -2
- package/dist/packages/_internals/workspace/dist/index.js +1 -2
- package/dist/packages/_internals/workspace/dist/index.js.map +1 -1
- package/dist/platform-auth-host.js +1 -2
- package/dist/provider-display-name.js +1 -2
- package/dist/review-verdict.d.ts +1 -0
- package/dist/review-verdict.d.ts.map +1 -1
- package/dist/review-verdict.js +9 -3
- package/dist/review-verdict.js.map +1 -1
- package/dist/routes/attention-activity.js +1 -2
- package/dist/routes/attention-parked.js +1 -2
- package/dist/routes/attention-proposed.js +1 -2
- package/dist/routes/attention-providers.js +1 -2
- package/dist/routes/attention.js +1 -2
- package/dist/routes/automation-runs.js +1 -2
- package/dist/routes/config.d.ts +4 -0
- package/dist/routes/config.d.ts.map +1 -1
- package/dist/routes/config.js +7 -2
- package/dist/routes/config.js.map +1 -1
- package/dist/routes/contracts.js +1 -2
- package/dist/routes/custom-provider-source.js +1 -2
- package/dist/routes/fs.js +1 -2
- package/dist/routes/intake.js +1 -2
- package/dist/routes/knowledge.js +1 -2
- package/dist/routes/oauth.js +1 -2
- package/dist/routes/projects.js +1 -2
- package/dist/routes/provider-credentials.js +1 -2
- package/dist/routes/route.js +1 -2
- package/dist/routes/session-access.js +1 -2
- package/dist/routes/skills.js +1 -2
- package/dist/routes/source-control-sessions.js +5 -6
- package/dist/routes/source-control-settings.js +1 -2
- package/dist/routes/surface.js +2 -3
- package/dist/routes/telemetry.js +1 -2
- package/dist/routes/tenant-credentials.js +1 -2
- package/dist/routes/work-items.js +2 -3
- package/dist/rules/binding-context.js +1 -2
- package/dist/rules/decision-applicability.js +1 -2
- package/dist/rules/dispatch-errors.js +1 -2
- package/dist/rules/dispatcher.js +1 -2
- package/dist/rules/event-rules.js +1 -2
- package/dist/rules/processor.js +1 -2
- package/dist/rules/resolve.js +1 -2
- package/dist/rules/review-source-tool.js +1 -2
- package/dist/rules/start-coordinator.js +1 -2
- package/dist/rules/terminal-cleanup.js +1 -2
- package/dist/rules/tools.js +1 -2
- package/dist/rules/transition-service.js +1 -2
- package/dist/rules/types.d.ts +4 -1
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +1 -2
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.js +1 -2
- package/dist/sandbox/callback-factory-sandbox.js +1 -2
- package/dist/sandbox/git-ref.js +1 -2
- package/dist/sandbox/local-factory-sandbox.d.ts +12 -4
- package/dist/sandbox/local-factory-sandbox.d.ts.map +1 -1
- package/dist/sandbox/local-factory-sandbox.js +32 -7
- package/dist/sandbox/local-factory-sandbox.js.map +1 -1
- package/dist/sandbox/materialization.js +1 -2
- package/dist/sandbox/session-retirement.js +1 -2
- package/dist/sandbox/session-sandbox.js +1 -2
- package/dist/sandbox/workdir.js +1 -2
- package/dist/secret-encryption.js +1 -2
- package/dist/server-error.js +1 -2
- package/dist/session/credential-policy.js +1 -2
- package/dist/session/default-model-hydration.js +1 -2
- package/dist/session/environment-repositories.js +1 -2
- package/dist/session/environment-state-processor.d.ts +0 -1
- package/dist/session/environment-state-processor.d.ts.map +1 -1
- package/dist/session/environment-state-processor.js +2 -3
- package/dist/session/environment-state-processor.js.map +1 -1
- package/dist/session/factory-session.js +1 -2
- package/dist/session/filesystem-capture.js +2 -3
- package/dist/session/filesystem-capture.js.map +1 -1
- package/dist/session/first-exec-capture.js +2 -3
- package/dist/session/first-exec-capture.js.map +1 -1
- package/dist/session/first-message-capture.js +1 -2
- package/dist/session/live-sessions.js +1 -2
- package/dist/session/memory-settings-hydration.js +1 -2
- package/dist/session/org-seed.js +1 -2
- package/dist/session/reply-credential-processor.js +1 -2
- package/dist/session/resource-migration.js +1 -2
- package/dist/session/run-audit.js +1 -2
- package/dist/session/session-threads.js +1 -2
- package/dist/session/session-title.js +1 -2
- package/dist/session/shell-commands.js +1 -2
- package/dist/session/source-control-tools.js +2 -3
- package/dist/session/thinking-default.js +1 -2
- package/dist/session/thread-session-stamp.js +1 -2
- package/dist/session/thread-title-mirror.js +1 -2
- package/dist/session/thread-title-mirror.js.map +1 -1
- package/dist/session/work-item-repository.js +1 -2
- package/dist/session-owner-signal.js +1 -2
- package/dist/skills/catalog.js +1 -2
- package/dist/skills/service.js +1 -2
- package/dist/spa-static.js +1 -2
- package/dist/state-signing.js +1 -2
- package/dist/storage/domains/audit/actions.js +1 -2
- package/dist/storage/domains/audit/actors.js +1 -2
- package/dist/storage/domains/audit/agent-audit.js +1 -2
- package/dist/storage/domains/audit/base.js +1 -2
- package/dist/storage/domains/audit/domain.js +1 -2
- package/dist/storage/domains/audit/wire.js +1 -2
- package/dist/storage/domains/channel-identity/base.js +1 -2
- package/dist/storage/domains/comments/activity.js +1 -2
- package/dist/storage/domains/comments/actor.js +1 -2
- package/dist/storage/domains/comments/base.js +1 -2
- package/dist/storage/domains/comments/domain.js +1 -2
- package/dist/storage/domains/comments/feed-context.js +1 -2
- package/dist/storage/domains/comments/parse.js +1 -2
- package/dist/storage/domains/comments/routes.js +1 -2
- package/dist/storage/domains/comments/schema.js +1 -2
- package/dist/storage/domains/comments/wire.js +1 -2
- package/dist/storage/domains/credentials/base.d.ts +4 -1
- package/dist/storage/domains/credentials/base.d.ts.map +1 -1
- package/dist/storage/domains/credentials/base.js +40 -44
- package/dist/storage/domains/credentials/base.js.map +1 -1
- package/dist/storage/domains/custom-providers/base.js +1 -2
- package/dist/storage/domains/filesystem/base.js +1 -2
- package/dist/storage/domains/intake/base.js +1 -2
- package/dist/storage/domains/integrations/base.js +1 -2
- package/dist/storage/domains/memory-settings/base.js +1 -2
- package/dist/storage/domains/model-defaults/base.js +1 -2
- package/dist/storage/domains/projects/base.js +1 -2
- package/dist/storage/domains/queue-health/base.js +1 -2
- package/dist/storage/domains/source-control/base.js +1 -2
- package/dist/storage/domains/source-control/inmemory.js +1 -2
- package/dist/storage/domains/work-items/base.js +1 -2
- package/dist/storage/domains/work-items/board-version.js +1 -2
- package/dist/storage/domains/work-items/metrics.js +1 -2
- package/dist/telemetry-types.js +1 -2
- package/dist/telemetry.js +1 -2
- package/dist/timing.js +1 -2
- package/dist/tools/annotations.js +1 -2
- package/dist/tools/approval-tools.js +1 -2
- package/dist/tools/deliver.js +2 -3
- package/dist/tools/index.js +1 -2
- package/dist/tools/messaging-tools.js +1 -2
- package/dist/tools/permissions.js +1 -2
- package/dist/tools/read-tools.js +1 -2
- package/dist/tools/reports.js +1 -2
- package/dist/tools/run-watch.js +1 -2
- package/dist/tools/sandbox-tools.js +1 -2
- package/dist/tools/scope.js +2 -3
- package/dist/tools/session-tools.js +1 -2
- package/dist/tools/sessions-state-processor.js +1 -2
- package/dist/tools/side-sessions.js +1 -2
- package/dist/tools/work-item-tools.js +1 -2
- package/dist/work-item-branch.js +1 -2
- package/dist/work-item-branch.js.map +1 -1
- package/dist/work-items/create-work-item.js +1 -2
- package/dist/work-items/decision-actions.js +1 -2
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +1 -3
- package/dist/workspace.js.map +1 -1
- package/factory-skills/factory-rereview/SKILL.md +12 -2
- package/factory-skills/factory-review/SKILL.md +12 -2
- package/factory-skills/factory-triage/SKILL.md +7 -7
- package/package.json +19 -17
package/dist/telemetry-types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/telemetry-types.ts
|
|
2
2
|
/** Browser-safe vocabulary: never send URLs, route parameters, or input contents. */
|
|
3
3
|
const FACTORY_WEB_PAGES = [
|
|
4
4
|
"onboarding",
|
|
@@ -17,7 +17,6 @@ const FACTORY_WEB_PAGES = [
|
|
|
17
17
|
"new_session",
|
|
18
18
|
"new_factory"
|
|
19
19
|
];
|
|
20
|
-
//#endregion
|
|
21
20
|
export { FACTORY_WEB_PAGES };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=telemetry-types.js.map
|
package/dist/telemetry.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PostHog } from "posthog-node";
|
|
2
|
-
|
|
2
|
+
// src/telemetry.ts
|
|
3
3
|
let client;
|
|
4
4
|
/** Start with the default platform auth provider; custom identity authorities are separate work. */
|
|
5
5
|
function isFactoryTelemetryEnabled(providerName) {
|
|
@@ -41,7 +41,6 @@ function captureFactoryWebActivity(activity, actor) {
|
|
|
41
41
|
});
|
|
42
42
|
} catch {}
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { captureFactoryWebActivity, isFactoryTelemetryEnabled };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=telemetry.js.map
|
package/dist/timing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/timing.ts
|
|
2
2
|
/**
|
|
3
3
|
* Verbose per-operation timing (HTTP requests, storage calls, sandbox
|
|
4
4
|
* commands). Off by default; enable per deployment with `FACTORY_TIMING=1`.
|
|
@@ -107,7 +107,6 @@ async function timedAboveThreshold(phase, thresholdMs, fn) {
|
|
|
107
107
|
if (elapsed > thresholdMs) process.stderr.write(`[factory:timing] slow ${phase} ${Math.round(elapsed)}ms\n`);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
//#endregion
|
|
111
110
|
export { createRequestTimingMiddleware, factoryTimingEnabled, instrumentAsyncMethods, instrumentMethods, timed, timedAboveThreshold, timedPhase };
|
|
112
111
|
|
|
113
112
|
//# sourceMappingURL=timing.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools/annotations.ts
|
|
2
2
|
const read = {
|
|
3
3
|
readOnlyHint: true,
|
|
4
4
|
destructiveHint: false,
|
|
@@ -96,7 +96,6 @@ const FACTORY_TOOL_ANNOTATIONS = {
|
|
|
96
96
|
title: "Fetch a work item"
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
//#endregion
|
|
100
99
|
export { FACTORY_TOOL_ANNOTATIONS };
|
|
101
100
|
|
|
102
101
|
//# sourceMappingURL=annotations.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { requirePerson } from "./scope.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createTool } from "@mastra/core/tools";
|
|
4
|
-
|
|
4
|
+
// src/tools/approval-tools.ts
|
|
5
5
|
/** Answers a tool call another session holds for approval. Only a signed-in person's turn may answer. */
|
|
6
6
|
function createFactoryApprovalTools(scope, deps) {
|
|
7
7
|
return { factory_answer_approval: createTool({
|
|
@@ -73,7 +73,6 @@ function createFactoryApprovalTools(scope, deps) {
|
|
|
73
73
|
}
|
|
74
74
|
}) };
|
|
75
75
|
}
|
|
76
|
-
//#endregion
|
|
77
76
|
export { createFactoryApprovalTools };
|
|
78
77
|
|
|
79
78
|
//# sourceMappingURL=approval-tools.js.map
|
package/dist/tools/deliver.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { listFactorySessionThreads, sessionMemoryResourceId, sessionStampCounts } from "../session/session-threads.js";
|
|
2
1
|
import { createSessionAsRowOwner } from "../integrations/subscription-session.js";
|
|
3
|
-
|
|
2
|
+
import { listFactorySessionThreads, sessionMemoryResourceId, sessionStampCounts } from "../session/session-threads.js";
|
|
3
|
+
// src/tools/deliver.ts
|
|
4
4
|
/** Notifications between Factory sessions all carry this source. */
|
|
5
5
|
const FACTORY_SESSION_NOTIFICATION_SOURCE = "factory-session";
|
|
6
6
|
/**
|
|
@@ -123,7 +123,6 @@ async function isSessionThread(controller, runs, thread, sessionId, loadRow) {
|
|
|
123
123
|
if (thread.id !== sessionId && !sessionStampCounts(row, thread.resourceId)) return false;
|
|
124
124
|
return thread.resourceId === await sessionMemoryResourceId(controller, row, runs);
|
|
125
125
|
}
|
|
126
|
-
//#endregion
|
|
127
126
|
export { FACTORY_SESSION_NOTIFICATION_SOURCE, deliverFactorySessionNotification, resolveSessionThread, sessionActivity };
|
|
128
127
|
|
|
129
128
|
//# sourceMappingURL=deliver.js.map
|
package/dist/tools/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createFactoryMessagingTools } from "./messaging-tools.js";
|
|
|
6
6
|
import { createFactorySessionTools } from "./session-tools.js";
|
|
7
7
|
import { createFactoryWorkItemTools } from "./work-item-tools.js";
|
|
8
8
|
import { FACTORY_TOOLS_WITHOUT_APPROVAL, applyFactoryToolPermissions } from "./permissions.js";
|
|
9
|
-
|
|
9
|
+
// src/tools/index.ts
|
|
10
10
|
/**
|
|
11
11
|
* The Factory toolset for a resolved scope. Tools take scope and storage by
|
|
12
12
|
* closure and never read the request context, so a non-session transport
|
|
@@ -30,7 +30,6 @@ function createFactoryTools({ scope, deps }) {
|
|
|
30
30
|
...createFactoryApprovalTools(scope, deps)
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { FACTORY_INTERACTIVE_KEY, FACTORY_TOOLS_WITHOUT_APPROVAL, applyFactoryToolPermissions, createFactoryTools, resolveFactoryToolScope };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,7 +5,7 @@ import { reportNotification, workItemReportAttributes, workItemReportRecipients
|
|
|
5
5
|
import { listSideSessions, sessionModel } from "./side-sessions.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { createTool } from "@mastra/core/tools";
|
|
8
|
-
|
|
8
|
+
// src/tools/messaging-tools.ts
|
|
9
9
|
/** Messages plus replies, per sender session, per target thread, per window. */
|
|
10
10
|
const SIGNAL_RATE_LIMIT = 10;
|
|
11
11
|
const SIGNAL_RATE_WINDOW_MS = 6e5;
|
|
@@ -518,7 +518,6 @@ function createFactoryMessagingTools(scope, deps) {
|
|
|
518
518
|
factory_subscribe_session: subscribe
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
|
-
//#endregion
|
|
522
521
|
export { SIGNAL_RATE_LIMIT, SIGNAL_RATE_WINDOW_MS, createFactoryMessagingTools };
|
|
523
522
|
|
|
524
523
|
//# sourceMappingURL=messaging-tools.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tools/permissions.ts
|
|
2
2
|
/**
|
|
3
3
|
* Factory tools that run without asking. Factory tools fall into the SDK's
|
|
4
4
|
* `mcp` category, whose default policy is `ask`, so each of these needs an
|
|
@@ -43,7 +43,6 @@ async function applyFactoryToolPermissions(session, { sessions }, toolNames = FA
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
//#endregion
|
|
47
46
|
export { FACTORY_TOOLS_WITHOUT_APPROVAL, applyFactoryToolPermissions };
|
|
48
47
|
|
|
49
48
|
//# sourceMappingURL=permissions.js.map
|
package/dist/tools/read-tools.js
CHANGED
|
@@ -5,7 +5,7 @@ import { sessionActivity } from "./deliver.js";
|
|
|
5
5
|
import { decisionRetryable, overtakenDecisionIds } from "../rules/decision-applicability.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { createTool } from "@mastra/core/tools";
|
|
8
|
-
|
|
8
|
+
// src/tools/read-tools.ts
|
|
9
9
|
const MAX_TEXT = 600;
|
|
10
10
|
const MAX_ERROR = 400;
|
|
11
11
|
const MAX_LIST = 50;
|
|
@@ -287,7 +287,6 @@ function createFactoryReadTools(scope, deps) {
|
|
|
287
287
|
})
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
//#endregion
|
|
291
290
|
export { MAX_ERROR, MAX_LIST, MAX_TEXT, createFactoryReadTools, findWorkItem, truncate, workItemNotFound, workItemNumber, workItemRefSchema, workItemStage };
|
|
292
291
|
|
|
293
292
|
//# sourceMappingURL=read-tools.js.map
|
package/dist/tools/reports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FACTORY_SESSION_NOTIFICATION_SOURCE } from "./deliver.js";
|
|
2
2
|
import { workItemNumber } from "./read-tools.js";
|
|
3
|
-
|
|
3
|
+
// src/tools/reports.ts
|
|
4
4
|
/** How each report status travels. Final reports never coalesce, so a later report can't overwrite them. */
|
|
5
5
|
const FACTORY_REPORT_FORMS = {
|
|
6
6
|
failed: {
|
|
@@ -403,7 +403,6 @@ function createSessionApprovalNotifier(deps) {
|
|
|
403
403
|
for (const recipient of recipients) await resolved.deliver(recipient, notification);
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
//#endregion
|
|
407
406
|
export { FACTORY_REPORT_FORMS, createSessionApprovalNotifier, createSessionRunEndReporter, createStageChangeNotifier, createWorkItemRunEndReporter, hasFinalReport, repeatsLastFailure, reportNotification, sendRunEndReport, workItemReportAttributes, workItemReportRecipients };
|
|
408
407
|
|
|
409
408
|
//# sourceMappingURL=reports.js.map
|
package/dist/tools/run-watch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FACTORY_OPEN_RUN_STALE_MS, heartbeatSessionOpenRun } from "../session/run-audit.js";
|
|
2
|
-
|
|
2
|
+
// src/tools/run-watch.ts
|
|
3
3
|
/** How much of a run's error message a `failed` report quotes. */
|
|
4
4
|
const ERROR_MESSAGE_LENGTH = 400;
|
|
5
5
|
/**
|
|
@@ -136,7 +136,6 @@ function runOutcome(reason, parked, errorMessage) {
|
|
|
136
136
|
default: return { status: "done" };
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
//#endregion
|
|
140
139
|
export { heartbeatOpenRunUntilEnd, observeSessionRunReports, runOutcome, usageLimitReason };
|
|
141
140
|
|
|
142
141
|
//# sourceMappingURL=run-watch.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { createTool } from "@mastra/core/tools";
|
|
3
|
-
|
|
3
|
+
// src/tools/sandbox-tools.ts
|
|
4
4
|
/** Tools a session uses on its own sandbox. Every session with a sandbox gets them. */
|
|
5
5
|
function createFactorySandboxTools(scope, deps) {
|
|
6
6
|
return { factory_recreate_sandbox: createTool({
|
|
@@ -34,7 +34,6 @@ function createFactorySandboxTools(scope, deps) {
|
|
|
34
34
|
}
|
|
35
35
|
}) };
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { createFactorySandboxTools };
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=sandbox-tools.js.map
|
package/dist/tools/scope.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FACTORY_INTERACTIVE_KEY, factoryUserOrgId, getFactoryAuthUserFromContext, getFactoryAuthUserId } from "../auth.js";
|
|
2
|
-
import { isWorkerSession } from "../session/session-threads.js";
|
|
3
2
|
import { auditActorProfile } from "../storage/domains/audit/base.js";
|
|
4
|
-
|
|
3
|
+
import { isWorkerSession } from "../session/session-threads.js";
|
|
4
|
+
// src/tools/scope.ts
|
|
5
5
|
/** Linked Slack sender, separate from the session owner's model-credential identity. */
|
|
6
6
|
const FACTORY_SLACK_SENDER_KEY = "mastra__factorySlackSender";
|
|
7
7
|
/**
|
|
@@ -78,7 +78,6 @@ function requirePerson(scope, action) {
|
|
|
78
78
|
if (scope.interactive) return;
|
|
79
79
|
throw new Error(`Only a person can ${action}. Nobody signed in started this turn (it came from a notification, webhook or rule); ask the person to do it from the board or by messaging this session.`);
|
|
80
80
|
}
|
|
81
|
-
//#endregion
|
|
82
81
|
export { FACTORY_INTERACTIVE_KEY, FACTORY_SLACK_SENDER_KEY, requirePerson, resolveFactoryToolScope };
|
|
83
82
|
|
|
84
83
|
//# sourceMappingURL=scope.js.map
|
|
@@ -16,7 +16,7 @@ import { heartbeatOpenRunUntilEnd } from "./run-watch.js";
|
|
|
16
16
|
import { RequestContext } from "@mastra/core/request-context";
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
import { createTool } from "@mastra/core/tools";
|
|
19
|
-
|
|
19
|
+
// src/tools/session-tools.ts
|
|
20
20
|
const TITLE_LENGTH = 120;
|
|
21
21
|
/** Who renews the open-run entries this process writes; one id per process, like the dispatcher's. */
|
|
22
22
|
const FACTORY_TOOLS_OWNER_ID = `factory-tools:${globalThis.crypto.randomUUID()}`;
|
|
@@ -423,7 +423,6 @@ function createFactorySessionTools(scope, deps) {
|
|
|
423
423
|
factory_switch_session_model: switchModel
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
//#endregion
|
|
427
426
|
export { FACTORY_TOOLS_OWNER_ID, createFactorySessionTools };
|
|
428
427
|
|
|
429
428
|
//# sourceMappingURL=session-tools.js.map
|
|
@@ -3,7 +3,7 @@ import "../boards/index.js";
|
|
|
3
3
|
import { resolveFactoryToolScope } from "./scope.js";
|
|
4
4
|
import { itemLabel, lastReport, listSessionNotifications, listSideSessions, newestNotification } from "./side-sessions.js";
|
|
5
5
|
import { createHash } from "crypto";
|
|
6
|
-
|
|
6
|
+
// src/tools/sessions-state-processor.ts
|
|
7
7
|
const STATE_ID = "factory-sessions";
|
|
8
8
|
/** Finished side sessions and items that reached a terminal stage drop out after this long. */
|
|
9
9
|
const FACTORY_SESSIONS_MAX_AGE_MS = 864e5;
|
|
@@ -184,7 +184,6 @@ var FactorySessionsStateProcessor = class {
|
|
|
184
184
|
return lines.join("\n");
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
//#endregion
|
|
188
187
|
export { FACTORY_SESSIONS_MAX_AGE_MS, FACTORY_SESSIONS_MAX_ROWS, FACTORY_SESSIONS_QUIET_MS, FactorySessionsStateProcessor };
|
|
189
188
|
|
|
190
189
|
//# sourceMappingURL=sessions-state-processor.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FACTORY_SESSION_NOTIFICATION_SOURCE, resolveSessionThread } from "./deliver.js";
|
|
2
2
|
import { workItemNumber } from "./read-tools.js";
|
|
3
|
-
|
|
3
|
+
// src/tools/side-sessions.ts
|
|
4
4
|
/** Recent notifications scanned to find each side session's last report. */
|
|
5
5
|
const SIDE_SESSION_NOTIFICATION_SCAN = 100;
|
|
6
6
|
function lastReport(record) {
|
|
@@ -77,7 +77,6 @@ async function sessionModel(controller, sessions, workItems, sessionId) {
|
|
|
77
77
|
const persisted = (await controller.queryThreadById({ threadId }))?.metadata?.currentModelId;
|
|
78
78
|
return typeof persisted === "string" && persisted ? persisted : null;
|
|
79
79
|
}
|
|
80
|
-
//#endregion
|
|
81
80
|
export { SIDE_SESSION_NOTIFICATION_SCAN, itemLabel, lastReport, listSessionNotifications, listSideSessions, newestNotification, sessionModel };
|
|
82
81
|
|
|
83
82
|
//# sourceMappingURL=side-sessions.js.map
|
|
@@ -10,7 +10,7 @@ import { dismissFactoryDecision, resolveFactoryProposal, retryFactoryDecision }
|
|
|
10
10
|
import { randomUUID } from "crypto";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
import { createTool } from "@mastra/core/tools";
|
|
13
|
-
|
|
13
|
+
// src/tools/work-item-tools.ts
|
|
14
14
|
/**
|
|
15
15
|
* Factory tools that change work items: file one, move it, settle its
|
|
16
16
|
* decisions, and follow it. They act as the session's person (a human actor),
|
|
@@ -336,7 +336,6 @@ function createFactoryWorkItemTools(scope, deps) {
|
|
|
336
336
|
})
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
//#endregion
|
|
340
339
|
export { createFactoryWorkItemTools };
|
|
341
340
|
|
|
342
341
|
//# sourceMappingURL=work-item-tools.js.map
|
package/dist/work-item-branch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/work-item-branch.ts
|
|
2
2
|
/** Map a stored item's provenance onto the source vocabulary branch naming reads. */
|
|
3
3
|
function workItemBranchSource(externalSource) {
|
|
4
4
|
if (!externalSource) return "manual";
|
|
@@ -89,7 +89,6 @@ function mergeRequestNumberFromBranch(branch) {
|
|
|
89
89
|
const number = match ? Number(match[1]) : void 0;
|
|
90
90
|
return number !== void 0 && Number.isSafeInteger(number) ? number : void 0;
|
|
91
91
|
}
|
|
92
|
-
//#endregion
|
|
93
92
|
export { legacyGithubWorkItemBranch, mergeRequestNumberFromBranch, pullRequestNumberFromBranch, workItemBranch, workItemBranchSource, workItemNumber, workItemThreadTitle };
|
|
94
93
|
|
|
95
94
|
//# sourceMappingURL=work-item-branch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-item-branch.js","names":[],"sources":["../src/work-item-branch.ts"],"sourcesContent":["import type { ExternalWorkItemSource } from './storage/domains/work-items/base.js';\n\n/**\n * Where a card came from, in the vocabulary branch naming reads. Server rows\n * map their `externalSource` into this with {@link workItemBranchSource}; the\n * board's own `WorkItem['source']` is already this union.\n */\nexport type WorkItemBranchSource =\n | 'github-issue'\n | 'github-pr'\n | 'gitlab-issue'\n | 'gitlab-pr'\n | 'linear-issue'\n | 'jira-issue'\n | 'incidentio-follow-up'\n | 'slack-thread'\n | 'manual';\n\nexport interface WorkItemBranchInput {\n id: string;\n source: WorkItemBranchSource;\n metadata?: Record<string, unknown> | null;\n}\n\n/** Map a stored item's provenance onto the source vocabulary branch naming reads. */\nexport function workItemBranchSource(externalSource: ExternalWorkItemSource | null | undefined): WorkItemBranchSource {\n if (!externalSource) return 'manual';\n if (externalSource.integrationId === 'linear') return 'linear-issue';\n if (externalSource.integrationId === 'gitlab') {\n return externalSource.type === 'pull-request' ? 'gitlab-pr' : 'gitlab-issue';\n }\n if (externalSource.integrationId === 'jira') return 'jira-issue';\n if (externalSource.integrationId === 'incidentio') return 'incidentio-follow-up';\n // Only GitHub, GitLab, Linear, Jira, and incident.io carry provider identities; anything\n // else (a Slack thread, say) is a plain work item rather than a mislabeled GitHub issue.\n if (externalSource.integrationId !== 'github') return 'manual';\n return externalSource.type === 'pull-request' ? 'github-pr' : 'github-issue';\n}\n\nfunction branchNumber(metadata: Record<string, unknown>, key: string): number | undefined {\n const value = metadata[key] ?? metadata.number;\n return typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined;\n}\n\n/** The provider number a GitHub card carries — the `#12` its runs and thread titles name it by. */\nexport function workItemNumber(item: Pick<WorkItemBranchInput, 'source' | 'metadata'>): number | undefined {\n const metadata = item.metadata ?? {};\n if (item.source === 'github-issue') return branchNumber(metadata, 'githubIssueNumber');\n if (item.source === 'github-pr') return branchNumber(metadata, 'githubPullRequestNumber');\n if (item.source === 'gitlab-issue') return branchNumber(metadata, 'gitlabIssueIid');\n if (item.source === 'gitlab-pr') return branchNumber(metadata, 'gitlabMergeRequestIid');\n return;\n}\n\n/** How a card names its thread: a Linear title already opens with its identifier, a GitHub card gets its number here. */\nexport function workItemThreadTitle(\n item: Pick<WorkItemBranchInput, 'source' | 'metadata'> & { title: string },\n): string {\n const number = workItemNumber(item);\n if (number === undefined) return item.title;\n const kind = item.source === 'github-pr' ? 'PR' : item.source === 'gitlab-pr' ? 'MR' : 'Issue';\n return `${kind} #${number}: ${item.title}`;\n}\n\n/**\n * The last twelve alphanumerics of a work item id: the per-item suffix that keeps\n * provider numbers from colliding across the repositories of one factory. Issue\n * #13 exists in every repository, and a factory's sessions are unique per\n * user and branch across all of its repositories, so a branch named by the\n * number alone can only be held once per factory.\n */\nfunction itemSuffix(id: string): string {\n return id\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '')\n .slice(-12);\n}\n\n/**\n * The git branch an item's runs and sessions share, one grammar for both sides\n * of the wire: the dispatcher names autonomous run branches with it and the\n * board opens card sessions on it, so both converge on one checkout per item.\n * Provider numbers are only unique within a repository, so GitHub and GitLab\n * branches carry the item suffix as well. Cards without a provider identity\n * (manual, Slack) and cards whose metadata lost their identifier fall back to\n * the id-derived branch.\n */\nexport function workItemBranch(item: WorkItemBranchInput): string {\n const metadata = item.metadata ?? {};\n const providerNumber = workItemNumber(item);\n if (providerNumber !== undefined && (item.source === 'github-issue' || item.source === 'github-pr')) {\n const suffix = itemSuffix(item.id);\n const kind = item.source === 'github-issue' ? 'issue' : 'pr';\n return suffix ? `factory/${kind}-${providerNumber}-${suffix}` : `factory/${kind}-${providerNumber}`;\n }\n if (\n (item.source === 'linear-issue' || item.source === 'jira-issue' || item.source === 'incidentio-follow-up') &&\n typeof metadata.identifier === 'string'\n ) {\n const identifier = metadata.identifier.trim();\n if (identifier) {\n const provider = item.source === 'linear-issue' ? 'linear' : item.source === 'jira-issue' ? 'jira' : 'incidentio';\n return `factory/${provider}-${identifier.toLowerCase()}`;\n }\n }\n if (item.source === 'gitlab-pr' && providerNumber !== undefined) {\n const uniqueSuffix = itemSuffix(item.id);\n if (uniqueSuffix) return `factory/gitlab-mr-${providerNumber}-${uniqueSuffix}`;\n }\n if (item.source === 'gitlab-issue' && typeof metadata.identifier === 'string') {\n const identifier = metadata.identifier\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, '-');\n const uniqueSuffix = itemSuffix(item.id);\n if (identifier && uniqueSuffix) return `factory/gitlab-${identifier.slice(0, 60)}-${uniqueSuffix}`;\n }\n return `factory/item-${item.id}`;\n}\n\n/** The pre-suffix GitHub branch, for reusing sessions opened before card names were unique. */\nexport function legacyGithubWorkItemBranch(branch: string): string | undefined {\n const match = /^(factory\\/(?:issue|pr)-[1-9]\\d*)-[a-z0-9]{1,12}$/.exec(branch);\n return match?.[1];\n}\n\n/**\n * The pull request a `factory/pr-<number>-<item suffix>` branch was named after, the\n * inverse of {@link workItemBranch}. Branches from before the suffix (`factory/pr-<number>`)\n * still parse so existing checkouts can resolve their PR.\n */\nexport function pullRequestNumberFromBranch(branch: string): number | undefined {\n const match = /^factory\\/pr-([1-9]\\d*)(?:-[a-z0-9]{1,12})?$/.exec(branch);\n const number = match ? Number(match[1]) : undefined;\n return number !== undefined && Number.isSafeInteger(number) ? number : undefined;\n}\n\n/** The GitLab MR IID encoded in Factory's collision-resistant review branch. */\nexport function mergeRequestNumberFromBranch(branch: string): number | undefined {\n const match = /^factory\\/gitlab-mr-([1-9]\\d*)-[a-z0-9]{1,12}$/.exec(branch);\n const number = match ? Number(match[1]) : undefined;\n return number !== undefined && Number.isSafeInteger(number) ? number : undefined;\n}\n"],"mappings":";;AAyBA,SAAgB,qBAAqB,gBAAiF;CACpH,IAAI,CAAC,gBAAgB,OAAO;CAC5B,IAAI,eAAe,kBAAkB,UAAU,OAAO;CACtD,IAAI,eAAe,kBAAkB,UACnC,OAAO,eAAe,SAAS,iBAAiB,cAAc;CAEhE,IAAI,eAAe,kBAAkB,QAAQ,OAAO;CACpD,IAAI,eAAe,kBAAkB,cAAc,OAAO;CAG1D,IAAI,eAAe,kBAAkB,UAAU,OAAO;CACtD,OAAO,eAAe,SAAS,iBAAiB,cAAc;AAChE;AAEA,SAAS,aAAa,UAAmC,KAAiC;CACxF,MAAM,QAAQ,SAAS,QAAQ,SAAS;CACxC,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,QAAQ,IAAI,QAAQ,KAAA;AACrF;;AAGA,SAAgB,eAAe,MAA4E;CACzG,MAAM,WAAW,KAAK,YAAY,CAAC;CACnC,IAAI,KAAK,WAAW,gBAAgB,OAAO,aAAa,UAAU,mBAAmB;CACrF,IAAI,KAAK,WAAW,aAAa,OAAO,aAAa,UAAU,yBAAyB;CACxF,IAAI,KAAK,WAAW,gBAAgB,OAAO,aAAa,UAAU,gBAAgB;CAClF,IAAI,KAAK,WAAW,aAAa,OAAO,aAAa,UAAU,uBAAuB;AAExF;;AAGA,SAA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BAAkB,WAAW,MAAM,GAAG,EAAE,EAAE,GAAG;CACtF;CACA,OAAO,gBAAgB,KAAK;AAC9B;;AAGA,SAAgB,2BAA2B,QAAoC;CAE7E,OADc,oDAAoD,KAAK,MAC5D,CAAC,GAAG;AACjB;;;;;;AAOA,SAAgB,4BAA4B,QAAoC;CAC9E,MAAM,QAAQ,+CAA+C,KAAK,MAAM;CACxE,MAAM,SAAS,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAA;CAC1C,OAAO,WAAW,KAAA,KAAa,OAAO,cAAc,MAAM,IAAI,SAAS,KAAA;AACzE;;AAGA,SAAgB,6BAA6B,QAAoC;CAC/E,MAAM,QAAQ,iDAAiD,KAAK,MAAM;CAC1E,MAAM,SAAS,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAA;CAC1C,OAAO,WAAW,KAAA,KAAa,OAAO,cAAc,MAAM,IAAI,SAAS,KAAA;AACzE"}
|
|
1
|
+
{"version":3,"file":"work-item-branch.js","names":[],"sources":["../src/work-item-branch.ts"],"sourcesContent":["import type { ExternalWorkItemSource } from './storage/domains/work-items/base.js';\n\n/**\n * Where a card came from, in the vocabulary branch naming reads. Server rows\n * map their `externalSource` into this with {@link workItemBranchSource}; the\n * board's own `WorkItem['source']` is already this union.\n */\nexport type WorkItemBranchSource =\n | 'github-issue'\n | 'github-pr'\n | 'gitlab-issue'\n | 'gitlab-pr'\n | 'linear-issue'\n | 'jira-issue'\n | 'incidentio-follow-up'\n | 'slack-thread'\n | 'manual';\n\nexport interface WorkItemBranchInput {\n id: string;\n source: WorkItemBranchSource;\n metadata?: Record<string, unknown> | null;\n}\n\n/** Map a stored item's provenance onto the source vocabulary branch naming reads. */\nexport function workItemBranchSource(externalSource: ExternalWorkItemSource | null | undefined): WorkItemBranchSource {\n if (!externalSource) return 'manual';\n if (externalSource.integrationId === 'linear') return 'linear-issue';\n if (externalSource.integrationId === 'gitlab') {\n return externalSource.type === 'pull-request' ? 'gitlab-pr' : 'gitlab-issue';\n }\n if (externalSource.integrationId === 'jira') return 'jira-issue';\n if (externalSource.integrationId === 'incidentio') return 'incidentio-follow-up';\n // Only GitHub, GitLab, Linear, Jira, and incident.io carry provider identities; anything\n // else (a Slack thread, say) is a plain work item rather than a mislabeled GitHub issue.\n if (externalSource.integrationId !== 'github') return 'manual';\n return externalSource.type === 'pull-request' ? 'github-pr' : 'github-issue';\n}\n\nfunction branchNumber(metadata: Record<string, unknown>, key: string): number | undefined {\n const value = metadata[key] ?? metadata.number;\n return typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : undefined;\n}\n\n/** The provider number a GitHub card carries — the `#12` its runs and thread titles name it by. */\nexport function workItemNumber(item: Pick<WorkItemBranchInput, 'source' | 'metadata'>): number | undefined {\n const metadata = item.metadata ?? {};\n if (item.source === 'github-issue') return branchNumber(metadata, 'githubIssueNumber');\n if (item.source === 'github-pr') return branchNumber(metadata, 'githubPullRequestNumber');\n if (item.source === 'gitlab-issue') return branchNumber(metadata, 'gitlabIssueIid');\n if (item.source === 'gitlab-pr') return branchNumber(metadata, 'gitlabMergeRequestIid');\n return undefined;\n}\n\n/** How a card names its thread: a Linear title already opens with its identifier, a GitHub card gets its number here. */\nexport function workItemThreadTitle(\n item: Pick<WorkItemBranchInput, 'source' | 'metadata'> & { title: string },\n): string {\n const number = workItemNumber(item);\n if (number === undefined) return item.title;\n const kind = item.source === 'github-pr' ? 'PR' : item.source === 'gitlab-pr' ? 'MR' : 'Issue';\n return `${kind} #${number}: ${item.title}`;\n}\n\n/**\n * The last twelve alphanumerics of a work item id: the per-item suffix that keeps\n * provider numbers from colliding across the repositories of one factory. Issue\n * #13 exists in every repository, and a factory's sessions are unique per\n * user and branch across all of its repositories, so a branch named by the\n * number alone can only be held once per factory.\n */\nfunction itemSuffix(id: string): string {\n return id\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '')\n .slice(-12);\n}\n\n/**\n * The git branch an item's runs and sessions share, one grammar for both sides\n * of the wire: the dispatcher names autonomous run branches with it and the\n * board opens card sessions on it, so both converge on one checkout per item.\n * Provider numbers are only unique within a repository, so GitHub and GitLab\n * branches carry the item suffix as well. Cards without a provider identity\n * (manual, Slack) and cards whose metadata lost their identifier fall back to\n * the id-derived branch.\n */\nexport function workItemBranch(item: WorkItemBranchInput): string {\n const metadata = item.metadata ?? {};\n const providerNumber = workItemNumber(item);\n if (providerNumber !== undefined && (item.source === 'github-issue' || item.source === 'github-pr')) {\n const suffix = itemSuffix(item.id);\n const kind = item.source === 'github-issue' ? 'issue' : 'pr';\n return suffix ? `factory/${kind}-${providerNumber}-${suffix}` : `factory/${kind}-${providerNumber}`;\n }\n if (\n (item.source === 'linear-issue' || item.source === 'jira-issue' || item.source === 'incidentio-follow-up') &&\n typeof metadata.identifier === 'string'\n ) {\n const identifier = metadata.identifier.trim();\n if (identifier) {\n const provider = item.source === 'linear-issue' ? 'linear' : item.source === 'jira-issue' ? 'jira' : 'incidentio';\n return `factory/${provider}-${identifier.toLowerCase()}`;\n }\n }\n if (item.source === 'gitlab-pr' && providerNumber !== undefined) {\n const uniqueSuffix = itemSuffix(item.id);\n if (uniqueSuffix) return `factory/gitlab-mr-${providerNumber}-${uniqueSuffix}`;\n }\n if (item.source === 'gitlab-issue' && typeof metadata.identifier === 'string') {\n const identifier = metadata.identifier\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, '-');\n const uniqueSuffix = itemSuffix(item.id);\n if (identifier && uniqueSuffix) return `factory/gitlab-${identifier.slice(0, 60)}-${uniqueSuffix}`;\n }\n return `factory/item-${item.id}`;\n}\n\n/** The pre-suffix GitHub branch, for reusing sessions opened before card names were unique. */\nexport function legacyGithubWorkItemBranch(branch: string): string | undefined {\n const match = /^(factory\\/(?:issue|pr)-[1-9]\\d*)-[a-z0-9]{1,12}$/.exec(branch);\n return match?.[1];\n}\n\n/**\n * The pull request a `factory/pr-<number>-<item suffix>` branch was named after, the\n * inverse of {@link workItemBranch}. Branches from before the suffix (`factory/pr-<number>`)\n * still parse so existing checkouts can resolve their PR.\n */\nexport function pullRequestNumberFromBranch(branch: string): number | undefined {\n const match = /^factory\\/pr-([1-9]\\d*)(?:-[a-z0-9]{1,12})?$/.exec(branch);\n const number = match ? Number(match[1]) : undefined;\n return number !== undefined && Number.isSafeInteger(number) ? number : undefined;\n}\n\n/** The GitLab MR IID encoded in Factory's collision-resistant review branch. */\nexport function mergeRequestNumberFromBranch(branch: string): number | undefined {\n const match = /^factory\\/gitlab-mr-([1-9]\\d*)-[a-z0-9]{1,12}$/.exec(branch);\n const number = match ? Number(match[1]) : undefined;\n return number !== undefined && Number.isSafeInteger(number) ? number : undefined;\n}\n"],"mappings":";;AAyBA,SAAgB,qBAAqB,gBAAiF;CACpH,IAAI,CAAC,gBAAgB,OAAO;CAC5B,IAAI,eAAe,kBAAkB,UAAU,OAAO;CACtD,IAAI,eAAe,kBAAkB,UACnC,OAAO,eAAe,SAAS,iBAAiB,cAAc;CAEhE,IAAI,eAAe,kBAAkB,QAAQ,OAAO;CACpD,IAAI,eAAe,kBAAkB,cAAc,OAAO;CAG1D,IAAI,eAAe,kBAAkB,UAAU,OAAO;CACtD,OAAO,eAAe,SAAS,iBAAiB,cAAc;AAChE;AAEA,SAAS,aAAa,UAAmC,KAAiC;CACxF,MAAM,QAAQ,SAAS,QAAQ,SAAS;CACxC,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,QAAQ,IAAI,QAAQ,KAAA;AACrF;;AAGA,SAAgB,eAAe,MAA4E;CACzG,MAAM,WAAW,KAAK,YAAY,CAAC;CACnC,IAAI,KAAK,WAAW,gBAAgB,OAAO,aAAa,UAAU,mBAAmB;CACrF,IAAI,KAAK,WAAW,aAAa,OAAO,aAAa,UAAU,yBAAyB;CACxF,IAAI,KAAK,WAAW,gBAAgB,OAAO,aAAa,UAAU,gBAAgB;CAClF,IAAI,KAAK,WAAW,aAAa,OAAO,aAAa,UAAU,uBAAuB;AAExF;;AAGA,SAAgB,oBACd,MACQ;CACR,MAAM,S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AE,EAAE,GAAG;CACtF;CACA,OAAO,gBAAgB,KAAK;AAC9B;;AAGA,SAAgB,2BAA2B,QAAoC;CAE7E,OADc,oDAAoD,KAAK,MAC5D,CAAC,GAAG;AACjB;;;;;;AAOA,SAAgB,4BAA4B,QAAoC;CAC9E,MAAM,QAAQ,+CAA+C,KAAK,MAAM;CACxE,MAAM,SAAS,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAA;CAC1C,OAAO,WAAW,KAAA,KAAa,OAAO,cAAc,MAAM,IAAI,SAAS,KAAA;AACzE;;AAGA,SAAgB,6BAA6B,QAAoC;CAC/E,MAAM,QAAQ,iDAAiD,KAAK,MAAM;CAC1E,MAAM,SAAS,QAAQ,OAAO,MAAM,EAAE,IAAI,KAAA;CAC1C,OAAO,WAAW,KAAA,KAAa,OAAO,cAAc,MAAM,IAAI,SAAS,KAAA;AACzE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/work-items/create-work-item.ts
|
|
2
2
|
/**
|
|
3
3
|
* Upserts the card into its board's first phase, enters that phase as the
|
|
4
4
|
* person (rolling the card back if its entry rules refuse it), then audits
|
|
@@ -95,7 +95,6 @@ async function createFactoryWorkItem({ workItems, boards, transitionService, aud
|
|
|
95
95
|
item
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { createFactoryWorkItem };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=create-work-item.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { decisionRetryable, overtakenDecisionIds } from "../rules/decision-applicability.js";
|
|
2
2
|
import { factoryDecisionType } from "../routes/attention-providers.js";
|
|
3
3
|
import "../routes/attention.js";
|
|
4
|
-
|
|
4
|
+
// src/work-items/decision-actions.ts
|
|
5
5
|
const notRetryable = (message) => ({
|
|
6
6
|
ok: false,
|
|
7
7
|
code: "decision_not_retryable",
|
|
@@ -64,7 +64,6 @@ function dismissFactoryDecision(args) {
|
|
|
64
64
|
action: "dismiss"
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
export { dismissFactoryDecision, resolveFactoryProposal, retryFactoryDecision };
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=decision-actions.js.map
|
package/dist/workspace.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,mCAAmC,CAAC;AAItG,OAAO,EAAoB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EACV,cAAc,EAEd,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AA6B9E,OAAO,KAAK,EAAE,qBAAqB,EAA4C,MAAM,8BAA8B,CAAC;AAQpH,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjG,OAAO,KAAK,EAAwB,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACjH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAO7E,eAAO,MAAM,2BAA2B,QAQQ,CAAC;AAEjD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,GAAG,SAAS,CAU7F;AAED,eAAO,MAAM,mBAAmB,aAU9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,aAMrC,CAAC;AASH;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,MAA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,gBAAgB,CAAC,CAAC;IAClG,WAAW,CAAC,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;CACpD,GACA,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAe1C;AAED,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,6BAAkC,IAs+BxE,SAAS,uBAAuB,2MACzC"}
|
package/dist/workspace.js
CHANGED
|
@@ -16,7 +16,7 @@ import { fileURLToPath } from "url";
|
|
|
16
16
|
import { SandboxFilesystem } from "@mastra/code-sdk/agents/sandbox-filesystem";
|
|
17
17
|
import { MASTRACODE_WORKSPACE_TOOLS } from "@mastra/code-sdk/agents/tool-availability";
|
|
18
18
|
import { DEFAULT_CONFIG_DIR } from "@mastra/code-sdk/constants";
|
|
19
|
-
|
|
19
|
+
// src/workspace.ts
|
|
20
20
|
const WORKSPACE_ID_PREFIX = "mfw";
|
|
21
21
|
const bundleDirectory = dirname(fileURLToPath(import.meta.url));
|
|
22
22
|
const bundledFactorySkillsPath = join(bundleDirectory, "factory-skills");
|
|
@@ -832,7 +832,6 @@ function createWorkspaceFactory(options = {}) {
|
|
|
832
832
|
dir: entry.dir,
|
|
833
833
|
branch: null,
|
|
834
834
|
defaultBranch: repo.defaultBranch,
|
|
835
|
-
position: repo.position,
|
|
836
835
|
setupStatus: repo.setupCommand ? "ok" : "skipped"
|
|
837
836
|
};
|
|
838
837
|
states.push(state);
|
|
@@ -1008,7 +1007,6 @@ function createWorkspaceFactory(options = {}) {
|
|
|
1008
1007
|
};
|
|
1009
1008
|
return (context) => timed("workspace.resolve", () => resolve(context));
|
|
1010
1009
|
}
|
|
1011
|
-
//#endregion
|
|
1012
1010
|
export { BUNDLED_FACTORY_SKILLS_PATH, FACTORY_SKILL_NAMES, FactorySkillSource, FactoryWorkspaceRegistry, REVIEW_ONLY_FACTORY_SKILLS, createWorkspaceFactory, environmentSandboxContext, rescanFactorySkills, resolveLocalFactorySkillsPath, resolveProjectEnvironment };
|
|
1013
1011
|
|
|
1014
1012
|
//# sourceMappingURL=workspace.js.map
|