@mastra/factory 0.25.0-alpha.4 → 0.25.0-alpha.6
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 +3 -1
- 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/default-thinking-level.d.ts +3 -0
- package/dist/default-thinking-level.d.ts.map +1 -0
- package/dist/default-thinking-level.js +5 -0
- package/dist/default-thinking-level.js.map +1 -0
- 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 +62 -21
- 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.d.ts +4 -0
- package/dist/integrations/gitlab/integration.d.ts.map +1 -1
- package/dist/integrations/gitlab/integration.js +12 -4
- package/dist/integrations/gitlab/integration.js.map +1 -1
- 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.d.ts +6 -0
- package/dist/integrations/gitlab/routes.d.ts.map +1 -1
- package/dist/integrations/gitlab/routes.js +154 -3
- package/dist/integrations/gitlab/routes.js.map +1 -1
- package/dist/integrations/gitlab/rules.d.ts.map +1 -1
- package/dist/integrations/gitlab/rules.js +5 -3
- package/dist/integrations/gitlab/rules.js.map +1 -1
- 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.d.ts +1 -1
- package/dist/integrations/jira/api.d.ts.map +1 -1
- package/dist/integrations/jira/api.js +2 -3
- package/dist/integrations/jira/api.js.map +1 -1
- package/dist/integrations/jira/claim.js +1 -2
- package/dist/integrations/jira/default-rules.js +1 -2
- package/dist/integrations/jira/integration.d.ts +3 -1
- package/dist/integrations/jira/integration.d.ts.map +1 -1
- package/dist/integrations/jira/integration.js +18 -4
- package/dist/integrations/jira/integration.js.map +1 -1
- 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.d.ts +1 -0
- package/dist/integrations/pull-request-head.d.ts.map +1 -1
- package/dist/integrations/pull-request-head.js +3 -3
- package/dist/integrations/pull-request-head.js.map +1 -1
- package/dist/integrations/reconciliation-config.js +1 -2
- package/dist/integrations/slack/channel-reply-processor.d.ts +1 -0
- package/dist/integrations/slack/channel-reply-processor.d.ts.map +1 -1
- package/dist/integrations/slack/channel-reply-processor.js +16 -6
- package/dist/integrations/slack/channel-reply-processor.js.map +1 -1
- package/dist/integrations/slack/channel-session-link-processor.d.ts +1 -0
- package/dist/integrations/slack/channel-session-link-processor.d.ts.map +1 -1
- package/dist/integrations/slack/channel-session-link-processor.js +2 -3
- package/dist/integrations/slack/channel-session-link-processor.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/integrations/slack/reply-tool.js +4 -13
- package/dist/integrations/slack/reply-tool.js.map +1 -1
- package/dist/integrations/slack/run-error-card.d.ts +3 -0
- package/dist/integrations/slack/run-error-card.d.ts.map +1 -0
- package/dist/integrations/slack/run-error-card.js +44 -0
- package/dist/integrations/slack/run-error-card.js.map +1 -0
- package/dist/integrations/slack/share-file-tool.js +1 -2
- package/dist/integrations/slack/slack.d.ts.map +1 -1
- package/dist/integrations/slack/slack.js +7 -4
- package/dist/integrations/slack/slack.js.map +1 -1
- 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 +7 -0
- package/dist/routes/config.d.ts.map +1 -1
- package/dist/routes/config.js +29 -3
- 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 +6 -4
- package/dist/routes/intake.js.map +1 -1
- 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 +3 -4
- package/dist/routes/surface.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +9 -3
- package/dist/rules/dispatcher.js.map +1 -1
- 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/run-error.d.ts +13 -0
- package/dist/run-error.d.ts.map +1 -0
- package/dist/run-error.js +81 -0
- package/dist/run-error.js.map +1 -0
- 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.d.ts +1 -1
- package/dist/session/thinking-default.d.ts.map +1 -1
- package/dist/session/thinking-default.js +11 -13
- package/dist/session/thinking-default.js.map +1 -1
- 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.d.ts +5 -0
- package/dist/storage/domains/intake/base.d.ts.map +1 -1
- package/dist/storage/domains/intake/base.js +10 -2
- package/dist/storage/domains/intake/base.js.map +1 -1
- 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.d.ts +0 -1
- package/dist/storage/domains/projects/base.d.ts.map +1 -1
- package/dist/storage/domains/projects/base.js +5 -6
- package/dist/storage/domains/projects/base.js.map +1 -1
- 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.d.ts +0 -2
- package/dist/tools/run-watch.d.ts.map +1 -1
- package/dist/tools/run-watch.js +4 -44
- package/dist/tools/run-watch.js.map +1 -1
- 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-gitlab-review/SKILL.md +1 -1
- package/factory-skills/factory-plan/SKILL.md +1 -1
- package/factory-skills/factory-rereview/SKILL.md +14 -3
- package/factory-skills/factory-review/SKILL.md +14 -3
- package/factory-skills/factory-self-review/SKILL.md +1 -1
- package/factory-skills/factory-triage/SKILL.md +52 -29
- package/package.json +19 -17
|
@@ -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,SAAgB,oBACd,MACQ;CACR,MAAM,SAAS,eAAe,IAAI;CAClC,IAAI,WAAW,KAAA,GAAW,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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,SAAS,eAAe,IAAI;CAClC,IAAI,WAAW,KAAA,GAAW,OAAO,KAAK;CAEtC,OAAO,GAD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B,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,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI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AC;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
|