hammoc 1.5.0 → 1.6.0
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 +8 -2
- package/package.json +2 -2
- package/packages/client/dist/assets/{agentExampleHighlight-BgwTm15v.js → agentExampleHighlight-ltj9ce0U.js} +1 -1
- package/packages/client/dist/assets/{commandTokenHighlight-BljHwnrK.js → commandTokenHighlight-ji_ViMb4.js} +1 -1
- package/packages/client/dist/assets/{index-D3LxqW3f.js → index-B-DiRGuz.js} +1 -1
- package/packages/client/dist/assets/index-B09doO8H.js +139 -0
- package/packages/client/dist/assets/{index-NqJdhlek.js → index-BT4RIi0U.js} +535 -510
- package/packages/client/dist/assets/index-DyNJ5jEW.css +32 -0
- package/packages/client/dist/assets/{snippetTokenHighlight-DWsaQXX0.js → snippetTokenHighlight-CP3v4o2g.js} +1 -1
- package/packages/client/dist/index.html +2 -2
- package/packages/client/dist/sw.js +1 -1
- package/packages/server/dist/controllers/bmadCoreConfigController.d.ts +41 -0
- package/packages/server/dist/controllers/bmadCoreConfigController.d.ts.map +1 -0
- package/packages/server/dist/controllers/bmadCoreConfigController.js +172 -0
- package/packages/server/dist/controllers/bmadCoreConfigController.js.map +1 -0
- package/packages/server/dist/controllers/contextBuilderController.d.ts +43 -0
- package/packages/server/dist/controllers/contextBuilderController.d.ts.map +1 -0
- package/packages/server/dist/controllers/contextBuilderController.js +159 -0
- package/packages/server/dist/controllers/contextBuilderController.js.map +1 -0
- package/packages/server/dist/controllers/harnessAgentController.d.ts +7 -0
- package/packages/server/dist/controllers/harnessAgentController.d.ts.map +1 -1
- package/packages/server/dist/controllers/harnessAgentController.js +33 -0
- package/packages/server/dist/controllers/harnessAgentController.js.map +1 -1
- package/packages/server/dist/controllers/harnessBundleController.d.ts +37 -0
- package/packages/server/dist/controllers/harnessBundleController.d.ts.map +1 -0
- package/packages/server/dist/controllers/harnessBundleController.js +312 -0
- package/packages/server/dist/controllers/harnessBundleController.js.map +1 -0
- package/packages/server/dist/controllers/harnessCommandController.d.ts +7 -0
- package/packages/server/dist/controllers/harnessCommandController.d.ts.map +1 -1
- package/packages/server/dist/controllers/harnessCommandController.js +33 -0
- package/packages/server/dist/controllers/harnessCommandController.js.map +1 -1
- package/packages/server/dist/controllers/harnessHookController.d.ts.map +1 -1
- package/packages/server/dist/controllers/harnessHookController.js +44 -1
- package/packages/server/dist/controllers/harnessHookController.js.map +1 -1
- package/packages/server/dist/controllers/harnessMcpController.d.ts.map +1 -1
- package/packages/server/dist/controllers/harnessMcpController.js +62 -1
- package/packages/server/dist/controllers/harnessMcpController.js.map +1 -1
- package/packages/server/dist/controllers/harnessShareScopeController.d.ts +9 -0
- package/packages/server/dist/controllers/harnessShareScopeController.d.ts.map +1 -1
- package/packages/server/dist/controllers/harnessShareScopeController.js +48 -1
- package/packages/server/dist/controllers/harnessShareScopeController.js.map +1 -1
- package/packages/server/dist/controllers/marketplaceController.d.ts +19 -0
- package/packages/server/dist/controllers/marketplaceController.d.ts.map +1 -0
- package/packages/server/dist/controllers/marketplaceController.js +74 -0
- package/packages/server/dist/controllers/marketplaceController.js.map +1 -0
- package/packages/server/dist/controllers/observabilityController.d.ts +32 -0
- package/packages/server/dist/controllers/observabilityController.d.ts.map +1 -0
- package/packages/server/dist/controllers/observabilityController.js +148 -0
- package/packages/server/dist/controllers/observabilityController.js.map +1 -0
- package/packages/server/dist/handlers/streamCallbacks.d.ts +8 -0
- package/packages/server/dist/handlers/streamCallbacks.d.ts.map +1 -1
- package/packages/server/dist/handlers/streamCallbacks.js +8 -0
- package/packages/server/dist/handlers/streamCallbacks.js.map +1 -1
- package/packages/server/dist/handlers/websocket.d.ts.map +1 -1
- package/packages/server/dist/handlers/websocket.js +24 -2
- package/packages/server/dist/handlers/websocket.js.map +1 -1
- package/packages/server/dist/routes/harness.d.ts.map +1 -1
- package/packages/server/dist/routes/harness.js +58 -0
- package/packages/server/dist/routes/harness.js.map +1 -1
- package/packages/server/dist/services/bmadCoreConfigService.d.ts +86 -0
- package/packages/server/dist/services/bmadCoreConfigService.d.ts.map +1 -0
- package/packages/server/dist/services/bmadCoreConfigService.js +175 -0
- package/packages/server/dist/services/bmadCoreConfigService.js.map +1 -0
- package/packages/server/dist/services/bmadStatusService.d.ts +9 -0
- package/packages/server/dist/services/bmadStatusService.d.ts.map +1 -1
- package/packages/server/dist/services/bmadStatusService.js +59 -6
- package/packages/server/dist/services/bmadStatusService.js.map +1 -1
- package/packages/server/dist/services/chatService.js +1 -1
- package/packages/server/dist/services/chatService.js.map +1 -1
- package/packages/server/dist/services/contextBuilderScriptTemplate.d.ts +24 -0
- package/packages/server/dist/services/contextBuilderScriptTemplate.d.ts.map +1 -0
- package/packages/server/dist/services/contextBuilderScriptTemplate.js +181 -0
- package/packages/server/dist/services/contextBuilderScriptTemplate.js.map +1 -0
- package/packages/server/dist/services/contextBuilderService.d.ts +68 -0
- package/packages/server/dist/services/contextBuilderService.d.ts.map +1 -0
- package/packages/server/dist/services/contextBuilderService.js +345 -0
- package/packages/server/dist/services/contextBuilderService.js.map +1 -0
- package/packages/server/dist/services/fileWatcherService.d.ts.map +1 -1
- package/packages/server/dist/services/fileWatcherService.js +40 -0
- package/packages/server/dist/services/fileWatcherService.js.map +1 -1
- package/packages/server/dist/services/harnessAgentService.d.ts +18 -0
- package/packages/server/dist/services/harnessAgentService.d.ts.map +1 -1
- package/packages/server/dist/services/harnessAgentService.js +55 -0
- package/packages/server/dist/services/harnessAgentService.js.map +1 -1
- package/packages/server/dist/services/harnessBundleService.d.ts +145 -0
- package/packages/server/dist/services/harnessBundleService.d.ts.map +1 -0
- package/packages/server/dist/services/harnessBundleService.js +1318 -0
- package/packages/server/dist/services/harnessBundleService.js.map +1 -0
- package/packages/server/dist/services/harnessCommandService.d.ts +21 -0
- package/packages/server/dist/services/harnessCommandService.d.ts.map +1 -1
- package/packages/server/dist/services/harnessCommandService.js +64 -0
- package/packages/server/dist/services/harnessCommandService.js.map +1 -1
- package/packages/server/dist/services/harnessHookService.d.ts +27 -0
- package/packages/server/dist/services/harnessHookService.d.ts.map +1 -1
- package/packages/server/dist/services/harnessHookService.js +52 -0
- package/packages/server/dist/services/harnessHookService.js.map +1 -1
- package/packages/server/dist/services/harnessMcpService.d.ts +24 -1
- package/packages/server/dist/services/harnessMcpService.d.ts.map +1 -1
- package/packages/server/dist/services/harnessMcpService.js +70 -0
- package/packages/server/dist/services/harnessMcpService.js.map +1 -1
- package/packages/server/dist/services/harnessShareScopeService.d.ts +19 -0
- package/packages/server/dist/services/harnessShareScopeService.d.ts.map +1 -1
- package/packages/server/dist/services/harnessShareScopeService.js +65 -0
- package/packages/server/dist/services/harnessShareScopeService.js.map +1 -1
- package/packages/server/dist/services/issueService.d.ts.map +1 -1
- package/packages/server/dist/services/issueService.js +1 -0
- package/packages/server/dist/services/issueService.js.map +1 -1
- package/packages/server/dist/services/marketplaceService.d.ts +50 -0
- package/packages/server/dist/services/marketplaceService.d.ts.map +1 -0
- package/packages/server/dist/services/marketplaceService.js +326 -0
- package/packages/server/dist/services/marketplaceService.js.map +1 -0
- package/packages/server/dist/services/observabilityService.d.ts +87 -0
- package/packages/server/dist/services/observabilityService.d.ts.map +1 -0
- package/packages/server/dist/services/observabilityService.js +0 -0
- package/packages/server/dist/services/observabilityService.js.map +1 -0
- package/packages/server/dist/services/queueService.d.ts.map +1 -1
- package/packages/server/dist/services/queueService.js +3 -0
- package/packages/server/dist/services/queueService.js.map +1 -1
- package/packages/server/dist/services/sessionService.d.ts +16 -0
- package/packages/server/dist/services/sessionService.d.ts.map +1 -1
- package/packages/server/dist/services/sessionService.js +125 -0
- package/packages/server/dist/services/sessionService.js.map +1 -1
- package/packages/server/dist/services/tokenCountService.d.ts +71 -0
- package/packages/server/dist/services/tokenCountService.d.ts.map +1 -0
- package/packages/server/dist/services/tokenCountService.js +313 -0
- package/packages/server/dist/services/tokenCountService.js.map +1 -0
- package/packages/server/dist/snippets/apply-qa-fixes +7 -5
- package/packages/server/dist/snippets/qa-review +5 -1
- package/packages/server/dist/utils/assertSafeBundlePath.d.ts +29 -0
- package/packages/server/dist/utils/assertSafeBundlePath.d.ts.map +1 -0
- package/packages/server/dist/utils/assertSafeBundlePath.js +53 -0
- package/packages/server/dist/utils/assertSafeBundlePath.js.map +1 -0
- package/packages/server/dist/utils/bundledBinaryModelSupport.d.ts +7 -0
- package/packages/server/dist/utils/bundledBinaryModelSupport.d.ts.map +1 -0
- package/packages/server/dist/utils/bundledBinaryModelSupport.js +107 -0
- package/packages/server/dist/utils/bundledBinaryModelSupport.js.map +1 -0
- package/packages/server/dist/utils/effortUtils.d.ts +2 -2
- package/packages/server/dist/utils/effortUtils.js +5 -5
- package/packages/server/dist/utils/effortUtils.js.map +1 -1
- package/packages/server/dist/utils/errors.d.ts +1 -0
- package/packages/server/dist/utils/errors.d.ts.map +1 -1
- package/packages/server/dist/utils/errors.js +17 -0
- package/packages/server/dist/utils/errors.js.map +1 -1
- package/packages/server/dist/utils/harnessBundleSchema.d.ts +14 -12
- package/packages/server/dist/utils/harnessBundleSchema.d.ts.map +1 -1
- package/packages/server/dist/utils/harnessBundleSchema.js +11 -1
- package/packages/server/dist/utils/harnessBundleSchema.js.map +1 -1
- package/packages/server/dist/utils/harnessPaths.d.ts +40 -0
- package/packages/server/dist/utils/harnessPaths.d.ts.map +1 -1
- package/packages/server/dist/utils/harnessPaths.js +123 -0
- package/packages/server/dist/utils/harnessPaths.js.map +1 -1
- package/packages/server/package.json +2 -1
- package/packages/server/resources/internals/INDEX.md +3 -1
- package/packages/server/resources/internals/bmad-qa-fix-marker.md +32 -0
- package/packages/server/resources/internals/harness-files.md +22 -0
- package/packages/server/resources/internals/observability-storage.md +23 -0
- package/packages/server/resources/manual/02-chat.md +2 -2
- package/packages/server/resources/manual/05-projects.md +3 -1
- package/packages/server/resources/manual/10-project-board.md +4 -3
- package/packages/server/resources/manual/11-bmad-method-integration.md +10 -8
- package/packages/server/resources/manual/12-harness-workbench.md +82 -1
- package/packages/server/resources/manual/13-settings.md +4 -4
- package/packages/shared/dist/index.d.ts +4 -0
- package/packages/shared/dist/index.d.ts.map +1 -1
- package/packages/shared/dist/index.js +8 -0
- package/packages/shared/dist/index.js.map +1 -1
- package/packages/shared/dist/types/bmadCoreConfig.d.ts +71 -0
- package/packages/shared/dist/types/bmadCoreConfig.d.ts.map +1 -0
- package/packages/shared/dist/types/bmadCoreConfig.js +30 -0
- package/packages/shared/dist/types/bmadCoreConfig.js.map +1 -0
- package/packages/shared/dist/types/bmadStatus.d.ts +10 -0
- package/packages/shared/dist/types/bmadStatus.d.ts.map +1 -1
- package/packages/shared/dist/types/bmadStatus.js.map +1 -1
- package/packages/shared/dist/types/board.d.ts +6 -0
- package/packages/shared/dist/types/board.d.ts.map +1 -1
- package/packages/shared/dist/types/contextBuilder.d.ts +102 -0
- package/packages/shared/dist/types/contextBuilder.d.ts.map +1 -0
- package/packages/shared/dist/types/contextBuilder.js +55 -0
- package/packages/shared/dist/types/contextBuilder.js.map +1 -0
- package/packages/shared/dist/types/harnessBundle.d.ts +35 -0
- package/packages/shared/dist/types/harnessBundle.d.ts.map +1 -1
- package/packages/shared/dist/types/marketplace.d.ts +83 -0
- package/packages/shared/dist/types/marketplace.d.ts.map +1 -0
- package/packages/shared/dist/types/marketplace.js +18 -0
- package/packages/shared/dist/types/marketplace.js.map +1 -0
- package/packages/shared/dist/types/observability.d.ts +148 -0
- package/packages/shared/dist/types/observability.d.ts.map +1 -0
- package/packages/shared/dist/types/observability.js +24 -0
- package/packages/shared/dist/types/observability.js.map +1 -0
- package/packages/shared/dist/types/preferences.d.ts +2 -0
- package/packages/shared/dist/types/preferences.d.ts.map +1 -1
- package/packages/shared/dist/types/preferences.js.map +1 -1
- package/packages/shared/dist/types/sdk.d.ts +1 -1
- package/packages/shared/dist/types/sdk.d.ts.map +1 -1
- package/packages/shared/dist/types/sdk.js +1 -1
- package/packages/shared/dist/types/sdk.js.map +1 -1
- package/packages/client/dist/assets/index-CjyjnXB8.css +0 -32
|
@@ -6,13 +6,13 @@ import type { ThinkingEffort } from '@hammoc/shared';
|
|
|
6
6
|
/**
|
|
7
7
|
* Clamp unsupported effort levels:
|
|
8
8
|
* · 'max' → 'high' unless model supports it (Opus 4.6+, Sonnet 4.6)
|
|
9
|
-
* · 'xhigh' → 'high' unless model supports it (Opus 4.7
|
|
9
|
+
* · 'xhigh' → 'high' unless model supports it (Opus 4.7+)
|
|
10
10
|
* Other levels pass through unchanged.
|
|
11
11
|
*/
|
|
12
12
|
export declare function clampEffortForModel(effort: ThinkingEffort | undefined, model: string | undefined): ThinkingEffort | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* Whether the model supports Anthropic's adaptive thinking mode
|
|
15
|
-
* (`thinking: { type: 'adaptive' }`). Opus 4.7 requires adaptive;
|
|
15
|
+
* (`thinking: { type: 'adaptive' }`). Opus 4.7+ requires adaptive;
|
|
16
16
|
* Opus 4.6 and Sonnet 4.6 accept adaptive as the recommended mode.
|
|
17
17
|
* Older models (Sonnet 4.5, Opus 4.5, Haiku, Sonnet 4, etc.) do NOT
|
|
18
18
|
* support adaptive and must stay on the legacy `maxThinkingTokens` path.
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Clamp unsupported effort levels:
|
|
7
7
|
* · 'max' → 'high' unless model supports it (Opus 4.6+, Sonnet 4.6)
|
|
8
|
-
* · 'xhigh' → 'high' unless model supports it (Opus 4.7
|
|
8
|
+
* · 'xhigh' → 'high' unless model supports it (Opus 4.7+)
|
|
9
9
|
* Other levels pass through unchanged.
|
|
10
10
|
*/
|
|
11
11
|
export function clampEffortForModel(effort, model) {
|
|
12
12
|
if (!effort)
|
|
13
13
|
return effort;
|
|
14
14
|
const supportsMax = !!model && (model === 'opus' || model === 'sonnet' ||
|
|
15
|
-
model.includes('opus-4-6') || model.includes('opus-4-7') || model.includes('sonnet-4-6'));
|
|
16
|
-
const supportsXHigh = !!model && (model === 'opus' || model.includes('opus-4-7'));
|
|
15
|
+
model.includes('opus-4-6') || model.includes('opus-4-7') || model.includes('opus-4-8') || model.includes('sonnet-4-6'));
|
|
16
|
+
const supportsXHigh = !!model && (model === 'opus' || model.includes('opus-4-7') || model.includes('opus-4-8'));
|
|
17
17
|
if (effort === 'max' && !supportsMax)
|
|
18
18
|
return 'high';
|
|
19
19
|
if (effort === 'xhigh' && !supportsXHigh)
|
|
@@ -22,7 +22,7 @@ export function clampEffortForModel(effort, model) {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Whether the model supports Anthropic's adaptive thinking mode
|
|
25
|
-
* (`thinking: { type: 'adaptive' }`). Opus 4.7 requires adaptive;
|
|
25
|
+
* (`thinking: { type: 'adaptive' }`). Opus 4.7+ requires adaptive;
|
|
26
26
|
* Opus 4.6 and Sonnet 4.6 accept adaptive as the recommended mode.
|
|
27
27
|
* Older models (Sonnet 4.5, Opus 4.5, Haiku, Sonnet 4, etc.) do NOT
|
|
28
28
|
* support adaptive and must stay on the legacy `maxThinkingTokens` path.
|
|
@@ -31,6 +31,6 @@ export function supportsAdaptiveThinking(model) {
|
|
|
31
31
|
if (!model)
|
|
32
32
|
return false;
|
|
33
33
|
return (model === 'opus' || model === 'sonnet' ||
|
|
34
|
-
model.includes('opus-4-6') || model.includes('opus-4-7') || model.includes('sonnet-4-6'));
|
|
34
|
+
model.includes('opus-4-6') || model.includes('opus-4-7') || model.includes('opus-4-8') || model.includes('sonnet-4-6'));
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=effortUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effortUtils.js","sourceRoot":"","sources":["../../src/utils/effortUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAkC,EAAE,KAAyB;IAC/F,IAAI,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IAC3B,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,IAAI,CAC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AC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CACvH,CAAC;AACJ,CAAC"}
|
|
@@ -12,6 +12,7 @@ export declare enum SDKErrorCode {
|
|
|
12
12
|
NETWORK_ERROR = "NETWORK_ERROR",
|
|
13
13
|
INVALID_REQUEST = "INVALID_REQUEST",
|
|
14
14
|
CONTEXT_OVERFLOW = "CONTEXT_OVERFLOW",
|
|
15
|
+
RESUME_THINKING_INVALID = "RESUME_THINKING_INVALID",
|
|
15
16
|
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
16
17
|
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
17
18
|
INVALID_PATH = "INVALID_PATH",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IAIrC,uBAAuB,4BAA4B;IACnD,mBAAmB,wBAAwB;IAC3C,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY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C,EAAE,MAAM;CAQpD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAqFrE"}
|
|
@@ -14,6 +14,10 @@ export var SDKErrorCode;
|
|
|
14
14
|
SDKErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
15
15
|
SDKErrorCode["INVALID_REQUEST"] = "INVALID_REQUEST";
|
|
16
16
|
SDKErrorCode["CONTEXT_OVERFLOW"] = "CONTEXT_OVERFLOW";
|
|
17
|
+
// Resume rejected because thinking blocks in the latest assistant turn no
|
|
18
|
+
// longer match their original signatures (typically after the CLI restructures
|
|
19
|
+
// a long conversation on resume). Recoverable by stripping thinking blocks.
|
|
20
|
+
SDKErrorCode["RESUME_THINKING_INVALID"] = "RESUME_THINKING_INVALID";
|
|
17
21
|
SDKErrorCode["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
|
|
18
22
|
SDKErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
|
|
19
23
|
SDKErrorCode["INVALID_PATH"] = "INVALID_PATH";
|
|
@@ -29,6 +33,7 @@ export const SDK_ERROR_STATUS = {
|
|
|
29
33
|
[SDKErrorCode.NETWORK_ERROR]: 503,
|
|
30
34
|
[SDKErrorCode.INVALID_REQUEST]: 400,
|
|
31
35
|
[SDKErrorCode.CONTEXT_OVERFLOW]: 400,
|
|
36
|
+
[SDKErrorCode.RESUME_THINKING_INVALID]: 400,
|
|
32
37
|
[SDKErrorCode.SERVICE_UNAVAILABLE]: 503,
|
|
33
38
|
[SDKErrorCode.PERMISSION_DENIED]: 403,
|
|
34
39
|
[SDKErrorCode.INVALID_PATH]: 400,
|
|
@@ -154,6 +159,18 @@ export function parseSDKError(error, lang) {
|
|
|
154
159
|
if (message.includes('abort') || error.name === 'AbortError') {
|
|
155
160
|
return new AbortedError(error, t?.('error.aborted'));
|
|
156
161
|
}
|
|
162
|
+
// Check for resume-time thinking-block signature rejection.
|
|
163
|
+
// The API rejects a resumed conversation whose latest assistant turn carries
|
|
164
|
+
// thinking blocks that no longer match their original signatures, e.g. after
|
|
165
|
+
// the CLI compacts/restructures a long conversation on resume. The message is:
|
|
166
|
+
// "`thinking` or `redacted_thinking` blocks in the latest assistant message
|
|
167
|
+
// cannot be modified. These blocks must remain as they were..."
|
|
168
|
+
if (message.includes('thinking') &&
|
|
169
|
+
(message.includes('cannot be modified') || message.includes('must remain as they were'))) {
|
|
170
|
+
return new SDKError(error.message, SDKErrorCode.RESUME_THINKING_INVALID, {
|
|
171
|
+
originalError: error,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
157
174
|
// Check for context overflow / token limit errors
|
|
158
175
|
if (message.includes('context window') ||
|
|
159
176
|
message.includes('context length') ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,2DAA2C,CAAA;IAC3C,6DAA6C,CAAA;IAC7C,+CAA+B,CAAA;IAC/B,mDAAmC,CAAA;IACnC,qDAAqC,CAAA;IACrC,0EAA0E;IAC1E,+EAA+E;IAC/E,4EAA4E;IAC5E,mEAAmD,CAAA;IACnD,2DAA2C,CAAA;IAC3C,uDAAuC,CAAA;IACvC,6CAA6B,CAAA;IAC7B,mCAAmB,CAAA;AACrB,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GA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E,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;QAED,kDAAkD;QAClD,IACE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;YAClC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YACnC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAC9B,CAAC;YACD,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,gBAAgB,EAAE;gBAChE,aAAa,EAAE,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;QAED,gCAAgC;QAChC,IAAI,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACvE,OAAO,IAAI,uBAAuB,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;QAC7E,CAAC;QAED,+BAA+B;QAC/B,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE;YACvD,aAAa,EAAE,KAAK;SACrB,CAAC,CAAC;IACL,CAAC;IAED,2BAA2B;IAC3B,OAAO,IAAI,QAAQ,CACjB,MAAM,CAAC,KAAK,CAAC,EACb,YAAY,CAAC,OAAO,CACrB,CAAC;AACJ,CAAC"}
|
|
@@ -18,6 +18,16 @@ import { z } from 'zod';
|
|
|
18
18
|
* future-version bundles fall through to the AC5.a "futureBundle" branch
|
|
19
19
|
* before this schema is even consulted (the import service inspects the raw
|
|
20
20
|
* JSON's version field first, then runs full Zod validation).
|
|
21
|
+
*
|
|
22
|
+
* `includes` is intentionally LOOSE (`z.array(z.string())`) rather than
|
|
23
|
+
* `z.array(sectionSchema)` so a `bundleVersion === 1` manifest carrying a
|
|
24
|
+
* future-domain stranger section (e.g. `['claude-md', 'future-section']`)
|
|
25
|
+
* still parses. The import service's `computePreview` then surfaces unknown
|
|
26
|
+
* sections via `preview.unknownSections` per AC5.b instead of bailing with
|
|
27
|
+
* `compatibility: 'malformed'`. Export-request validation
|
|
28
|
+
* (`exportBundleRequestSchema`) keeps `sectionSchema` strict — we never
|
|
29
|
+
* accept unknown sections from outbound callers, only tolerate them
|
|
30
|
+
* inbound.
|
|
21
31
|
*/
|
|
22
32
|
export declare const bundleManifestSchema: z.ZodObject<{
|
|
23
33
|
bundleVersion: z.ZodLiteral<1>;
|
|
@@ -25,15 +35,7 @@ export declare const bundleManifestSchema: z.ZodObject<{
|
|
|
25
35
|
claudeCodeSpecVersion: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
26
36
|
createdAt: z.ZodString;
|
|
27
37
|
sourceProjectSlug: z.ZodString;
|
|
28
|
-
includes: z.ZodArray<z.
|
|
29
|
-
agents: "agents";
|
|
30
|
-
hooks: "hooks";
|
|
31
|
-
commands: "commands";
|
|
32
|
-
skills: "skills";
|
|
33
|
-
mcp: "mcp";
|
|
34
|
-
"claude-md": "claude-md";
|
|
35
|
-
bmad: "bmad";
|
|
36
|
-
}>>;
|
|
38
|
+
includes: z.ZodArray<z.ZodString>;
|
|
37
39
|
secretsPolicy: z.ZodEnum<{
|
|
38
40
|
excluded: "excluded";
|
|
39
41
|
placeholder: "placeholder";
|
|
@@ -49,9 +51,9 @@ export declare const bundleManifestSchema: z.ZodObject<{
|
|
|
49
51
|
agent: "agent";
|
|
50
52
|
command: "command";
|
|
51
53
|
skill: "skill";
|
|
54
|
+
"claude-md": "claude-md";
|
|
52
55
|
mcp: "mcp";
|
|
53
56
|
hook: "hook";
|
|
54
|
-
"claude-md": "claude-md";
|
|
55
57
|
bmad: "bmad";
|
|
56
58
|
}>;
|
|
57
59
|
identity: z.ZodString;
|
|
@@ -78,10 +80,10 @@ export declare const exportBundleRequestSchema: z.ZodObject<{
|
|
|
78
80
|
includes: z.ZodArray<z.ZodEnum<{
|
|
79
81
|
agents: "agents";
|
|
80
82
|
hooks: "hooks";
|
|
81
|
-
commands: "commands";
|
|
82
83
|
skills: "skills";
|
|
83
|
-
|
|
84
|
+
commands: "commands";
|
|
84
85
|
"claude-md": "claude-md";
|
|
86
|
+
mcp: "mcp";
|
|
85
87
|
bmad: "bmad";
|
|
86
88
|
}>>;
|
|
87
89
|
secretsPolicy: z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harnessBundleSchema.d.ts","sourceRoot":"","sources":["../../src/utils/harnessBundleSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0CxB
|
|
1
|
+
{"version":3,"file":"harnessBundleSchema.d.ts","sourceRoot":"","sources":["../../src/utils/harnessBundleSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0CxB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;iBAEjC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;iBAIpC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;iBAGnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;iBAEhC,CAAC"}
|
|
@@ -43,6 +43,16 @@ const bundleItemSchema = z.object({
|
|
|
43
43
|
* future-version bundles fall through to the AC5.a "futureBundle" branch
|
|
44
44
|
* before this schema is even consulted (the import service inspects the raw
|
|
45
45
|
* JSON's version field first, then runs full Zod validation).
|
|
46
|
+
*
|
|
47
|
+
* `includes` is intentionally LOOSE (`z.array(z.string())`) rather than
|
|
48
|
+
* `z.array(sectionSchema)` so a `bundleVersion === 1` manifest carrying a
|
|
49
|
+
* future-domain stranger section (e.g. `['claude-md', 'future-section']`)
|
|
50
|
+
* still parses. The import service's `computePreview` then surfaces unknown
|
|
51
|
+
* sections via `preview.unknownSections` per AC5.b instead of bailing with
|
|
52
|
+
* `compatibility: 'malformed'`. Export-request validation
|
|
53
|
+
* (`exportBundleRequestSchema`) keeps `sectionSchema` strict — we never
|
|
54
|
+
* accept unknown sections from outbound callers, only tolerate them
|
|
55
|
+
* inbound.
|
|
46
56
|
*/
|
|
47
57
|
export const bundleManifestSchema = z.object({
|
|
48
58
|
bundleVersion: z.literal(HARNESS_BUNDLE_VERSION),
|
|
@@ -50,7 +60,7 @@ export const bundleManifestSchema = z.object({
|
|
|
50
60
|
claudeCodeSpecVersion: z.union([z.string().min(1), z.null()]),
|
|
51
61
|
createdAt: z.string().min(1),
|
|
52
62
|
sourceProjectSlug: z.string().min(1),
|
|
53
|
-
includes: z.array(
|
|
63
|
+
includes: z.array(z.string().min(1)),
|
|
54
64
|
secretsPolicy: secretsPolicySchema,
|
|
55
65
|
pluginDependencies: z.array(pluginRefSchema),
|
|
56
66
|
items: z.array(bundleItemSchema),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harnessBundleSchema.js","sourceRoot":"","sources":["../../src/utils/harnessBundleSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,sBAAsB,GAMvB,MAAM,gBAAgB,CAAC;AAExB,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,eAA+D,CAAC,CAAC;AAE9F,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,aAAa,EAAE,mBAAmB,CAAU,CAAoC,CAAC;AAEjI,MAAM,gBAAgB,GA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AC;CACpD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC/B,CAAC,CAAC"}
|
|
@@ -31,4 +31,44 @@ export declare function resolveHarnessPath(ref: HarnessPathRef): Promise<Resolve
|
|
|
31
31
|
* project root, so traversal is impossible by construction.
|
|
32
32
|
*/
|
|
33
33
|
export declare function resolveProjectClaudeMdPath(projectSlug: string): Promise<ResolvedHarnessPath>;
|
|
34
|
+
/**
|
|
35
|
+
* Story 30.7 (Task A.5): resolve the project-root `<projectRoot>/.gitignore`
|
|
36
|
+
* path. Like `resolveProjectClaudeMdPath`, `.gitignore` sits outside the
|
|
37
|
+
* `.claude/` subtree, so `resolveHarnessPath` cannot reach it. This helper
|
|
38
|
+
* accepts only `projectSlug` (no caller-supplied relative path), so traversal
|
|
39
|
+
* is impossible by construction. Used by
|
|
40
|
+
* `harnessShareScopeService.appendGitignorePattern()` to safely append
|
|
41
|
+
* patterns like `**\/.claude/**\/*.local.*` when the sibling-save flow detects
|
|
42
|
+
* the pattern is missing.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveProjectGitignorePath(projectSlug: string): Promise<ResolvedHarnessPath>;
|
|
45
|
+
/**
|
|
46
|
+
* Story 31.1 (Task A.1): resolve the project-root
|
|
47
|
+
* `<projectRoot>/.bmad-core/core-config.yaml` path. Like
|
|
48
|
+
* `resolveProjectClaudeMdPath` / `resolveProjectGitignorePath`, the
|
|
49
|
+
* `.bmad-core/` tree sits OUTSIDE the project's `.claude/` subtree, so
|
|
50
|
+
* `resolveHarnessPath` would reject it as a traversal. This helper accepts
|
|
51
|
+
* only `projectSlug` (no caller-supplied relative path), so traversal is
|
|
52
|
+
* impossible by construction. Used by `bmadCoreConfigService` to read/patch
|
|
53
|
+
* the single config file the BMad config form edits.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveBmadCoreConfigPath(projectSlug: string): Promise<ResolvedHarnessPath>;
|
|
56
|
+
/**
|
|
57
|
+
* Story 31.2 (Task A.1): resolve the context-builder manifest path
|
|
58
|
+
* `<projectRoot>/.hammoc/context-builder.json`. Like the `.bmad-core/`
|
|
59
|
+
* resolver, the `.hammoc/` tree sits OUTSIDE the project's `.claude/` subtree,
|
|
60
|
+
* so `resolveHarnessPath` would reject it as a traversal. Accepts only
|
|
61
|
+
* `projectSlug` (no caller-supplied relative path), so traversal is impossible
|
|
62
|
+
* by construction. Used by `contextBuilderService` as the single manifest R/W
|
|
63
|
+
* chokepoint (no other module touches this path via `fs`).
|
|
64
|
+
*/
|
|
65
|
+
export declare function resolveContextBuilderManifestPath(projectSlug: string): Promise<ResolvedHarnessPath>;
|
|
66
|
+
/**
|
|
67
|
+
* Story 31.2 (Task A.1): resolve the generated script path
|
|
68
|
+
* `<projectRoot>/.hammoc/hooks/context-builder.mjs`. Same traversal-proof
|
|
69
|
+
* construction as `resolveContextBuilderManifestPath`. The generated `.mjs`
|
|
70
|
+
* runs standalone at every session start, assembling the `additionalContext`
|
|
71
|
+
* JSON the SessionStart hook emits.
|
|
72
|
+
*/
|
|
73
|
+
export declare function resolveContextBuilderScriptPath(projectSlug: string): Promise<ResolvedHarnessPath>;
|
|
34
74
|
//# sourceMappingURL=harnessPaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harnessPaths.d.ts","sourceRoot":"","sources":["../../src/utils/harnessPaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAWrE,6EAA6E;AAC7E,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED,wFAAwF;AACxF,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBhF;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAA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,CACnD,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,mBAAmB,CAAC,CAI9B"}
|
|
@@ -121,4 +121,127 @@ export async function resolveProjectClaudeMdPath(projectSlug) {
|
|
|
121
121
|
const absolutePath = path.join(resolvedRoot, 'CLAUDE.md');
|
|
122
122
|
return { resolvedRoot, absolutePath };
|
|
123
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Story 30.7 (Task A.5): resolve the project-root `<projectRoot>/.gitignore`
|
|
126
|
+
* path. Like `resolveProjectClaudeMdPath`, `.gitignore` sits outside the
|
|
127
|
+
* `.claude/` subtree, so `resolveHarnessPath` cannot reach it. This helper
|
|
128
|
+
* accepts only `projectSlug` (no caller-supplied relative path), so traversal
|
|
129
|
+
* is impossible by construction. Used by
|
|
130
|
+
* `harnessShareScopeService.appendGitignorePattern()` to safely append
|
|
131
|
+
* patterns like `**\/.claude/**\/*.local.*` when the sibling-save flow detects
|
|
132
|
+
* the pattern is missing.
|
|
133
|
+
*/
|
|
134
|
+
export async function resolveProjectGitignorePath(projectSlug) {
|
|
135
|
+
if (!projectSlug || projectSlug.includes('\0')) {
|
|
136
|
+
const err = new Error('invalid projectSlug');
|
|
137
|
+
err.code = HARNESS_ERRORS.HARNESS_PATH_DENIED.code;
|
|
138
|
+
throw err;
|
|
139
|
+
}
|
|
140
|
+
if (projectSlug.includes('..') || projectSlug.includes('/') || projectSlug.includes('\\')) {
|
|
141
|
+
const err = new Error('projectSlug must not contain path separators');
|
|
142
|
+
err.code = HARNESS_ERRORS.HARNESS_PATH_DENIED.code;
|
|
143
|
+
throw err;
|
|
144
|
+
}
|
|
145
|
+
let projectRoot;
|
|
146
|
+
try {
|
|
147
|
+
projectRoot = await projectService.resolveOriginalPath(projectSlug);
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
const wrapped = new Error(`Unable to resolve project root for "${projectSlug}": ${error.message}`);
|
|
151
|
+
wrapped.code = HARNESS_ERRORS.HARNESS_ROOT_MISSING.code;
|
|
152
|
+
throw wrapped;
|
|
153
|
+
}
|
|
154
|
+
const resolvedRoot = path.resolve(projectRoot);
|
|
155
|
+
const absolutePath = path.join(resolvedRoot, '.gitignore');
|
|
156
|
+
return { resolvedRoot, absolutePath };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Story 31.1 (Task A.1): resolve the project-root
|
|
160
|
+
* `<projectRoot>/.bmad-core/core-config.yaml` path. Like
|
|
161
|
+
* `resolveProjectClaudeMdPath` / `resolveProjectGitignorePath`, the
|
|
162
|
+
* `.bmad-core/` tree sits OUTSIDE the project's `.claude/` subtree, so
|
|
163
|
+
* `resolveHarnessPath` would reject it as a traversal. This helper accepts
|
|
164
|
+
* only `projectSlug` (no caller-supplied relative path), so traversal is
|
|
165
|
+
* impossible by construction. Used by `bmadCoreConfigService` to read/patch
|
|
166
|
+
* the single config file the BMad config form edits.
|
|
167
|
+
*/
|
|
168
|
+
export async function resolveBmadCoreConfigPath(projectSlug) {
|
|
169
|
+
if (!projectSlug || projectSlug.includes('\0')) {
|
|
170
|
+
const err = new Error('invalid projectSlug');
|
|
171
|
+
err.code = HARNESS_ERRORS.HARNESS_PATH_DENIED.code;
|
|
172
|
+
throw err;
|
|
173
|
+
}
|
|
174
|
+
if (projectSlug.includes('..') || projectSlug.includes('/') || projectSlug.includes('\\')) {
|
|
175
|
+
const err = new Error('projectSlug must not contain path separators');
|
|
176
|
+
err.code = HARNESS_ERRORS.HARNESS_PATH_DENIED.code;
|
|
177
|
+
throw err;
|
|
178
|
+
}
|
|
179
|
+
let projectRoot;
|
|
180
|
+
try {
|
|
181
|
+
projectRoot = await projectService.resolveOriginalPath(projectSlug);
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
const wrapped = new Error(`Unable to resolve project root for "${projectSlug}": ${error.message}`);
|
|
185
|
+
wrapped.code = HARNESS_ERRORS.HARNESS_ROOT_MISSING.code;
|
|
186
|
+
throw wrapped;
|
|
187
|
+
}
|
|
188
|
+
const resolvedRoot = path.resolve(projectRoot);
|
|
189
|
+
const absolutePath = path.join(resolvedRoot, '.bmad-core', 'core-config.yaml');
|
|
190
|
+
return { resolvedRoot, absolutePath };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Story 31.2 (Task A.1): resolve the context-builder manifest path
|
|
194
|
+
* `<projectRoot>/.hammoc/context-builder.json`. Like the `.bmad-core/`
|
|
195
|
+
* resolver, the `.hammoc/` tree sits OUTSIDE the project's `.claude/` subtree,
|
|
196
|
+
* so `resolveHarnessPath` would reject it as a traversal. Accepts only
|
|
197
|
+
* `projectSlug` (no caller-supplied relative path), so traversal is impossible
|
|
198
|
+
* by construction. Used by `contextBuilderService` as the single manifest R/W
|
|
199
|
+
* chokepoint (no other module touches this path via `fs`).
|
|
200
|
+
*/
|
|
201
|
+
export async function resolveContextBuilderManifestPath(projectSlug) {
|
|
202
|
+
const { resolvedRoot } = await resolveHammocRootForProject(projectSlug);
|
|
203
|
+
const absolutePath = path.join(resolvedRoot, '.hammoc', 'context-builder.json');
|
|
204
|
+
return { resolvedRoot, absolutePath };
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Story 31.2 (Task A.1): resolve the generated script path
|
|
208
|
+
* `<projectRoot>/.hammoc/hooks/context-builder.mjs`. Same traversal-proof
|
|
209
|
+
* construction as `resolveContextBuilderManifestPath`. The generated `.mjs`
|
|
210
|
+
* runs standalone at every session start, assembling the `additionalContext`
|
|
211
|
+
* JSON the SessionStart hook emits.
|
|
212
|
+
*/
|
|
213
|
+
export async function resolveContextBuilderScriptPath(projectSlug) {
|
|
214
|
+
const { resolvedRoot } = await resolveHammocRootForProject(projectSlug);
|
|
215
|
+
const absolutePath = path.join(resolvedRoot, '.hammoc', 'hooks', 'context-builder.mjs');
|
|
216
|
+
return { resolvedRoot, absolutePath };
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Shared resolver tail for the two `.hammoc/` helpers above — validates the
|
|
220
|
+
* slug (no null byte / path separators) and resolves the project root. Returns
|
|
221
|
+
* `resolvedRoot` = the project root (NOT `.hammoc/`), so each caller appends its
|
|
222
|
+
* own suffix; this keeps the traversal guard in one place.
|
|
223
|
+
*/
|
|
224
|
+
async function resolveHammocRootForProject(projectSlug) {
|
|
225
|
+
if (!projectSlug || projectSlug.includes('\0')) {
|
|
226
|
+
const err = new Error('invalid projectSlug');
|
|
227
|
+
err.code = HARNESS_ERRORS.HARNESS_PATH_DENIED.code;
|
|
228
|
+
throw err;
|
|
229
|
+
}
|
|
230
|
+
if (projectSlug.includes('..') || projectSlug.includes('/') || projectSlug.includes('\\')) {
|
|
231
|
+
const err = new Error('projectSlug must not contain path separators');
|
|
232
|
+
err.code = HARNESS_ERRORS.HARNESS_PATH_DENIED.code;
|
|
233
|
+
throw err;
|
|
234
|
+
}
|
|
235
|
+
let projectRoot;
|
|
236
|
+
try {
|
|
237
|
+
projectRoot = await projectService.resolveOriginalPath(projectSlug);
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
const wrapped = new Error(`Unable to resolve project root for "${projectSlug}": ${error.message}`);
|
|
241
|
+
wrapped.code = HARNESS_ERRORS.HARNESS_ROOT_MISSING.code;
|
|
242
|
+
throw wrapped;
|
|
243
|
+
}
|
|
244
|
+
const resolvedRoot = path.resolve(projectRoot);
|
|
245
|
+
return { resolvedRoot, absolutePath: resolvedRoot };
|
|
246
|
+
}
|
|
124
247
|
//# sourceMappingURL=harnessPaths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harnessPaths.js","sourceRoot":"","sources":["../../src/utils/harnessPaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAuB,MAAM,gBAAgB,CAAC;AAErE;;;;;;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15
15
|
"test:all": "vitest run"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@anthropic-ai/claude-agent-sdk": "^0.
|
|
18
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.158",
|
|
19
|
+
"@anthropic-ai/sdk": "^0.100.1",
|
|
19
20
|
"@hammoc/shared": "*",
|
|
20
21
|
"bcrypt": "^6.0.0",
|
|
21
22
|
"chokidar": "^5.0.0",
|
|
@@ -9,7 +9,9 @@ Read individual entries **on demand** when the user's request involves the under
|
|
|
9
9
|
## Entries
|
|
10
10
|
|
|
11
11
|
- [Image Storage](./image-storage.md) — On-disk path and filename scheme for chat-attached images
|
|
12
|
-
- [Harness File Layout](./harness-files.md) — Where `.claude/` items (skills, commands, agents, hooks, MCP servers, `CLAUDE.md`) live on disk, when changes take effect, and how the Secret-on-Shared guard relates to direct file writes
|
|
12
|
+
- [Harness File Layout](./harness-files.md) — Where `.claude/` items (skills, commands, agents, hooks, MCP servers, `CLAUDE.md`) live on disk, when changes take effect, the Context Builder's Hammoc-managed SessionStart files, plugin install-state paths, and how the Secret-on-Shared guard relates to direct file writes
|
|
13
|
+
- [Observability Storage](./observability-storage.md) — Where the MCP call log and exact-token-count cache live, their JSONL/JSON format, body-stripping, and 30-day retention
|
|
14
|
+
- [BMad QA-Fix Marker](./bmad-qa-fix-marker.md) — The `<!-- hammoc:qa-fix -->` story-file convention that drives QA re-review recommendations and the board's "QA Fixed" badge
|
|
13
15
|
|
|
14
16
|
## Maintenance
|
|
15
17
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# BMad QA-Fix Marker
|
|
2
|
+
|
|
3
|
+
A Hammoc-specific convention layered on top of standard BMad story files. It lets the project-overview Next Step Recommender (manual §11.5) and the board's "QA Fixed" badge (§10.7) know whether a developer has already addressed the **current** QA gate — without guessing from file modification times (the old, unreliable approach: `review-story` rewrites the story after the gate, which made a freshly-reviewed story look "stale").
|
|
4
|
+
|
|
5
|
+
## The marker
|
|
6
|
+
|
|
7
|
+
A single HTML comment inside the story markdown file:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
<!-- hammoc:qa-fix gate="<the gate's `updated` value>" applied="true|false" -->
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- It is an HTML comment, so standard BMad tooling ignores it and it never changes the story's Status or the gate file.
|
|
14
|
+
- `gate` is the QA gate's `updated:` value — it ties the marker to one specific gate. When QA later re-reviews, the gate's `updated` changes and any marker pointing at the old value becomes stale automatically.
|
|
15
|
+
- `applied="false"` → "QA flagged this gate; a fix is still needed." `applied="true"` → "Dev addressed this gate."
|
|
16
|
+
|
|
17
|
+
## Who writes it
|
|
18
|
+
|
|
19
|
+
- **QA review** (Hammoc's bundled `qa-review` snippet) appends `applied="false"` in the story's **QA Results** section when it issues a CONCERNS or FAIL gate.
|
|
20
|
+
- **Apply QA fixes** (the bundled `apply-qa-fixes` snippet) appends `applied="true"` in the story's **Completion Notes** after the fixes are made — without touching Status or the gate file.
|
|
21
|
+
|
|
22
|
+
If you perform a QA review or apply QA fixes **manually** (not through these snippets), append the matching marker yourself so the recommender and badge stay accurate.
|
|
23
|
+
|
|
24
|
+
## How it is read
|
|
25
|
+
|
|
26
|
+
The server (BMad status service) collects all markers in a story and matches them against the **current** gate's `updated` value to derive a per-story `gateFixState`:
|
|
27
|
+
|
|
28
|
+
- an `applied="true"` marker for the current gate → **`applied`** (Dev done; QA re-review is the next step)
|
|
29
|
+
- only an `applied="false"` marker for the current gate → **`needed`** (Dev must apply fixes)
|
|
30
|
+
- no marker for the current gate → **`undefined`** → the UI offers **both** actions (Apply QA fixes / Request QA review) and lets the user choose, because it can't tell whether fixes were applied (legacy story, external BMad project, or manually-edited gate)
|
|
31
|
+
|
|
32
|
+
An `applied` marker wins over a `needed` marker for the same gate. The board shows the sky-blue **QA Fixed** badge only when `gateFixState='applied'` for a FAIL/CONCERNS gate.
|
|
@@ -29,6 +29,28 @@ When the same name (skill, command, agent, hook, MCP server, snippet) exists in
|
|
|
29
29
|
|
|
30
30
|
Hammoc-native `%snippets` are a separate layer (see manual §4.6); they live under `<projectRoot>/.hammoc/snippets/` and `<homeDir>/.hammoc/snippets/`, **not** the `.claude/` tree.
|
|
31
31
|
|
|
32
|
+
## Context Builder generated files (Hammoc-managed)
|
|
33
|
+
|
|
34
|
+
The Context Builder (manual §12.17) writes two Hammoc-owned files plus one `settings.json` entry:
|
|
35
|
+
|
|
36
|
+
| File | Role |
|
|
37
|
+
|------|------|
|
|
38
|
+
| `<projectRoot>/.hammoc/context-builder.json` | Manifest — the single source of truth: `enabled` flag, reference-file list, dynamic-variable toggles, recent-commit count, custom-command list |
|
|
39
|
+
| `<projectRoot>/.hammoc/hooks/context-builder.mjs` | Generated Node.js SessionStart hook. Regenerated from the manifest on every change; reads the reference files fresh, recomputes the variables, runs acknowledged custom commands, and prints `{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"…"}}` |
|
|
40
|
+
| `<projectRoot>/.claude/settings.json` → `hooks.SessionStart[]` | Auto-registered entry whose `command` is `node "<absPath>/.hammoc/hooks/context-builder.mjs"` (forward-slash normalized) |
|
|
41
|
+
|
|
42
|
+
Hammoc recognizes its own SessionStart entry by the `.hammoc/hooks/context-builder.` substring in the command — there is no metadata key. **Do not hand-edit that entry or the `.mjs` script directly**: the Context Builder panel owns them and regenerates the script (overwriting manual edits) on the next save. To change the injected context, edit `context-builder.json` (or use the panel). User-authored SessionStart entries that do not contain the marker substring are left untouched.
|
|
43
|
+
|
|
44
|
+
## Plugin install state (read-only)
|
|
45
|
+
|
|
46
|
+
The Marketplace panel (manual §12.19) and the Plugins panel read Claude Code's own plugin bookkeeping under `<homeDir>/.claude/plugins/`:
|
|
47
|
+
|
|
48
|
+
- `known_marketplaces.json` — registered marketplace repos
|
|
49
|
+
- `marketplaces/<name>/.claude-plugin/marketplace.json` — each marketplace's catalog manifest (`plugins[]`)
|
|
50
|
+
- `installed_plugins.json` — which plugins are installed (used to mark catalog cards "Installed")
|
|
51
|
+
|
|
52
|
+
Hammoc only **reads** these; installs/uninstalls happen through the interactive `/plugin …` slash commands in a Claude CLI session, after which a file watcher refreshes the cards.
|
|
53
|
+
|
|
32
54
|
## Sharing scope
|
|
33
55
|
|
|
34
56
|
Each file's "share" status is computed from the project's `.gitignore`:
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Observability Storage
|
|
2
|
+
|
|
3
|
+
Hammoc's Observability panel (user-facing, manual §12.18) persists two kinds of data under the user's home `.hammoc` directory. These are **not** under `.claude/` and are reached with direct file reads, not through the harness file service.
|
|
4
|
+
|
|
5
|
+
`<homeDir>` must be resolved before use — Read does not expand `~`. On Windows that is `C:\Users\<user>\`.
|
|
6
|
+
|
|
7
|
+
## MCP / tool call log
|
|
8
|
+
|
|
9
|
+
- **Path:** `<homeDir>/.hammoc/observability/<projectSlug>.jsonl`
|
|
10
|
+
- **Format:** JSON Lines — one tool-call record per line. Each record holds: tool-use id, project slug, session id, server name (parsed from the `mcp__<server>__<tool>` prefix; `null` for built-in tools like Read/Edit/Bash), tool name, start timestamp (epoch ms), duration in ms (`null` if the call never returned), argument byte size, result byte size (`null` if no response), and a success flag (`null` if no response).
|
|
11
|
+
- **Bodies are never written** — only sizes. The log therefore cannot leak file contents or secrets.
|
|
12
|
+
- **Retention:** records older than 30 days (override with the `OBSERVABILITY_RETENTION_DAYS` env var) are pruned on append (throttled to ~30 min) and at server startup.
|
|
13
|
+
- **Written by:** the chat service hooks the existing SDK message stream and appends one record per tool result. "Orphan" calls (started, never returned) are flushed once at turn end with `null` duration / result / success.
|
|
14
|
+
|
|
15
|
+
## Exact token-count cache
|
|
16
|
+
|
|
17
|
+
- **Path:** `<homeDir>/.hammoc/observability/token-count-cache.json`
|
|
18
|
+
- **Format:** a JSON object mapping a SHA-256 hash of the input text → official token count.
|
|
19
|
+
- The **Exact count** button calls Anthropic's count-tokens API; the result is cached here keyed by content hash, so re-counting an unchanged file is free and the cache is shared across projects (identical files hash the same).
|
|
20
|
+
|
|
21
|
+
## Tokenizer preference
|
|
22
|
+
|
|
23
|
+
- The inline `~` hint is always a byte-size heuristic (size ÷ 4); a tokenizer-grade tier was evaluated but not adopted (it drifted 25–45% from the official count on Claude 4.x). The preference lives in `<homeDir>/.hammoc/preferences.json` under `observabilityTokenizer` and is global (all projects), though its toggle UI sits inside the Observability panel.
|
|
@@ -175,13 +175,13 @@ Control how much Claude "thinks" before responding. The intensity bar appears in
|
|
|
175
175
|
|
|
176
176
|
- **Low / Medium / High** — 3 levels, available for all models
|
|
177
177
|
- **Max** — 4th level, added for Opus 4.6 / Sonnet 4.6
|
|
178
|
-
- **XHigh** — 5th level, added
|
|
178
|
+
- **XHigh** — 5th level, added for **Opus 4.7+** (the default effort for these models is XHigh)
|
|
179
179
|
|
|
180
180
|
Behavior:
|
|
181
181
|
|
|
182
182
|
- Click the currently active level again to reset to default
|
|
183
183
|
- Cannot be changed while Claude is responding
|
|
184
|
-
- If you switch to a model that doesn't support the current level (e.g., XHigh →
|
|
184
|
+
- If you switch to a model that doesn't support the current level (e.g., XHigh → model without XHigh, or Max → model without Max), the effort automatically resets to the highest supported level
|
|
185
185
|
- When the active model is temporarily unknown (e.g., right after switching projects before the resolved model arrives), the dropdown keeps your saved choice instead of resetting it. As soon as the model is known, the effort is reclamped if necessary
|
|
186
186
|
|
|
187
187
|
The default thinking effort for new sessions can be configured in Settings > Global.
|
|
@@ -21,6 +21,8 @@ Each card has a **kebab menu** (⋮) with:
|
|
|
21
21
|
|
|
22
22
|
**Dashboard summary bar** appears at the top when projects exist, showing aggregate stats: Projects, Sessions, Active, Queue, Terminals.
|
|
23
23
|
|
|
24
|
+
**Header brand logo (Hammoc)** — The Hammoc logo on the left of every header is clickable and always returns you to the project list from any page (project Overview, Board, Sessions, Queue, Files, Git, Terminal, project Settings, chat session). Use it as a one-tap "Home" without going through the back button.
|
|
25
|
+
|
|
24
26
|
### 5.2 Creating a New Project
|
|
25
27
|
|
|
26
28
|
1. Click **"New Project"** on the project list page
|
|
@@ -36,7 +38,7 @@ Per-project settings live in their own tab inside each project (Overview / Queue
|
|
|
36
38
|
|
|
37
39
|
The Settings tab has a two-pane layout:
|
|
38
40
|
|
|
39
|
-
- **Left nav** —
|
|
41
|
+
- **Left nav** — Top-level groups: **General**, **Harness Workbench** (see §12), **Context Builder** (§12.17), **Observability** (§12.18), and **Marketplace** (§12.19). BMad projects also get a **BMad Settings** group (§12.16)
|
|
40
42
|
- **Right panel** — Form contents for the selected group
|
|
41
43
|
|
|
42
44
|
**General group** (per-project override fields):
|