@metabob/minibob 0.1.2
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/ARCHITECTURE.md +255 -0
- package/CHANGELOG.md +112 -0
- package/README.md +380 -0
- package/bin/minibob.js +36 -0
- package/dist/acp-gossip.d.ts +72 -0
- package/dist/acp-gossip.d.ts.map +1 -0
- package/dist/acp-gossip.js +156 -0
- package/dist/acp-gossip.js.map +1 -0
- package/dist/acp.d.ts +62 -0
- package/dist/acp.d.ts.map +1 -0
- package/dist/acp.js +292 -0
- package/dist/acp.js.map +1 -0
- package/dist/activity.d.ts +157 -0
- package/dist/activity.d.ts.map +1 -0
- package/dist/activity.js +518 -0
- package/dist/activity.js.map +1 -0
- package/dist/agent-runtime.d.ts +104 -0
- package/dist/agent-runtime.d.ts.map +1 -0
- package/dist/boredom.d.ts +125 -0
- package/dist/boredom.d.ts.map +1 -0
- package/dist/boredom.js +244 -0
- package/dist/boredom.js.map +1 -0
- package/dist/cli/acp-server.d.ts +23 -0
- package/dist/cli/acp-server.d.ts.map +1 -0
- package/dist/cli/burrow.d.ts +26 -0
- package/dist/cli/burrow.d.ts.map +1 -0
- package/dist/cli/doctor.d.ts +22 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/goal.d.ts +22 -0
- package/dist/cli/goal.d.ts.map +1 -0
- package/dist/cli/index.d.ts +47 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/instance-registry.d.ts +78 -0
- package/dist/cli/instance-registry.d.ts.map +1 -0
- package/dist/cli/observe.d.ts +35 -0
- package/dist/cli/observe.d.ts.map +1 -0
- package/dist/cli/vessel.d.ts +14 -0
- package/dist/cli/vessel.d.ts.map +1 -0
- package/dist/composition-observer.d.ts +96 -0
- package/dist/composition-observer.d.ts.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +128 -0
- package/dist/config.js.map +1 -0
- package/dist/docker/Dockerfile +35 -0
- package/dist/environment.d.ts +72 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +142 -0
- package/dist/environment.js.map +1 -0
- package/dist/goal-processor.d.ts +165 -0
- package/dist/goal-processor.d.ts.map +1 -0
- package/dist/helm/minibob-cluster/Chart.yaml +13 -0
- package/dist/helm/minibob-cluster/templates/_helpers.tpl +60 -0
- package/dist/helm/minibob-cluster/templates/configmap.yaml +11 -0
- package/dist/helm/minibob-cluster/templates/deployment.yaml +108 -0
- package/dist/helm/minibob-cluster/templates/secret.yaml +10 -0
- package/dist/helm/minibob-cluster/templates/service.yaml +37 -0
- package/dist/helm/minibob-cluster/values-local.yaml +41 -0
- package/dist/helm/minibob-cluster/values-production.yaml +57 -0
- package/dist/helm/minibob-cluster/values-testing-cluster.yaml +43 -0
- package/dist/helm/minibob-cluster/values.yaml +127 -0
- package/dist/improviser.d.ts +74 -0
- package/dist/improviser.d.ts.map +1 -0
- package/dist/impulse-filter.d.ts +74 -0
- package/dist/impulse-filter.d.ts.map +1 -0
- package/dist/impulse.d.ts +92 -0
- package/dist/impulse.d.ts.map +1 -0
- package/dist/impulse.js +234 -0
- package/dist/impulse.js.map +1 -0
- package/dist/lib.d.ts +29 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +18561 -0
- package/dist/lib.js.map +98 -0
- package/dist/lifecycle-hooks.d.ts +99 -0
- package/dist/lifecycle-hooks.d.ts.map +1 -0
- package/dist/lifecycle-hooks.js +135 -0
- package/dist/lifecycle-hooks.js.map +1 -0
- package/dist/llm.d.ts +31 -0
- package/dist/llm.d.ts.map +1 -0
- package/dist/llm.js +349 -0
- package/dist/llm.js.map +1 -0
- package/dist/mcp-activity-bridge.d.ts +66 -0
- package/dist/mcp-activity-bridge.d.ts.map +1 -0
- package/dist/mcp-activity-bridge.js +126 -0
- package/dist/mcp-activity-bridge.js.map +1 -0
- package/dist/mcp.d.ts +216 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +292 -0
- package/dist/mcp.js.map +1 -0
- package/dist/memory-agent.d.ts +92 -0
- package/dist/memory-agent.d.ts.map +1 -0
- package/dist/memory-agent.js +277 -0
- package/dist/memory-agent.js.map +1 -0
- package/dist/runtime-mapping.d.ts +97 -0
- package/dist/runtime-mapping.d.ts.map +1 -0
- package/dist/search-first-executor.d.ts +113 -0
- package/dist/search-first-executor.d.ts.map +1 -0
- package/dist/session.d.ts +48 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/template-extractor.d.ts +9 -0
- package/dist/template-extractor.d.ts.map +1 -0
- package/dist/template-generator.d.ts +12 -0
- package/dist/template-generator.d.ts.map +1 -0
- package/dist/tools.d.ts +58 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +771 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +503 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/understanding/analyzer.d.ts +55 -0
- package/dist/understanding/analyzer.d.ts.map +1 -0
- package/dist/understanding/explorer.d.ts +73 -0
- package/dist/understanding/explorer.d.ts.map +1 -0
- package/dist/understanding/index.d.ts +7 -0
- package/dist/understanding/index.d.ts.map +1 -0
- package/dist/understanding/types.d.ts +136 -0
- package/dist/understanding/types.d.ts.map +1 -0
- package/dist/validation.d.ts +29 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +106 -0
- package/dist/validation.js.map +1 -0
- package/dist/vessel-bootstrap.d.ts +190 -0
- package/dist/vessel-bootstrap.d.ts.map +1 -0
- package/dist/vessel-registry.d.ts +229 -0
- package/dist/vessel-registry.d.ts.map +1 -0
- package/index.ts +1329 -0
- package/package.json +54 -0
- package/src/acp-gossip.ts +193 -0
- package/src/acp.ts +362 -0
- package/src/activity.ts +1464 -0
- package/src/agent-runtime.ts +365 -0
- package/src/boredom.ts +423 -0
- package/src/cli/acp-server.ts +377 -0
- package/src/cli/burrow.ts +896 -0
- package/src/cli/doctor.ts +526 -0
- package/src/cli/goal.ts +224 -0
- package/src/cli/index.ts +147 -0
- package/src/cli/instance-registry.ts +271 -0
- package/src/cli/observe.ts +682 -0
- package/src/cli/vessel.ts +287 -0
- package/src/components/SystemOverview.tsx +331 -0
- package/src/composition-observer.ts +449 -0
- package/src/config.ts +172 -0
- package/src/environment.ts +167 -0
- package/src/goal-processor.ts +654 -0
- package/src/improviser.ts +591 -0
- package/src/impulse-filter.ts +273 -0
- package/src/impulse.ts +311 -0
- package/src/lib.ts +147 -0
- package/src/lifecycle-hooks.ts +181 -0
- package/src/llm.ts +434 -0
- package/src/mcp-activity-bridge.ts +158 -0
- package/src/mcp.ts +747 -0
- package/src/memory-agent.ts +316 -0
- package/src/runtime-mapping.ts +527 -0
- package/src/search-first-executor.ts +666 -0
- package/src/session.ts +141 -0
- package/src/template-extractor.ts +256 -0
- package/src/template-generator.ts +130 -0
- package/src/tools.ts +924 -0
- package/src/types.ts +497 -0
- package/src/understanding/analyzer.ts +354 -0
- package/src/understanding/explorer.ts +488 -0
- package/src/understanding/index.ts +27 -0
- package/src/understanding/types.ts +153 -0
- package/src/validation.ts +125 -0
- package/src/vessel-bootstrap.ts +440 -0
- package/src/vessel-registry.ts +621 -0
- package/templates/core/edit-file.json +85 -0
- package/templates/understanding/diagnose-problem.json +32 -0
- package/templates/understanding/explore-codebase-v2.json +57 -0
- package/templates/understanding/explore-codebase.json +37 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goal Processor - Core orchestrator for goal-driven activity execution
|
|
3
|
+
*
|
|
4
|
+
* This module transforms user goals into activity executions:
|
|
5
|
+
* 1. Receive user goal message
|
|
6
|
+
* 2. Get activity recommendations from metabob-activity-api (Thompson Sampling)
|
|
7
|
+
* 3. Execute recommended activity
|
|
8
|
+
* 4. Check goal completion
|
|
9
|
+
* 5. Loop until goal is complete or max attempts reached
|
|
10
|
+
*
|
|
11
|
+
* Architecture:
|
|
12
|
+
* User goal → GoalProcessor → Backend recommendations → ActivityExecutor → Goal complete
|
|
13
|
+
*
|
|
14
|
+
* Key principle: Backend (metabob-activity-api) handles activity recommendation
|
|
15
|
+
* based on historical execution data, success rates, and goal alignment.
|
|
16
|
+
*/
|
|
17
|
+
import type { ActivityExecution } from "./types";
|
|
18
|
+
import { ActivityExecutor } from "./activity";
|
|
19
|
+
/**
|
|
20
|
+
* Structured goal representation
|
|
21
|
+
*/
|
|
22
|
+
export interface Goal {
|
|
23
|
+
/** Original user message */
|
|
24
|
+
message: string;
|
|
25
|
+
/** Goal type inferred from message */
|
|
26
|
+
type: "feature" | "bugfix" | "refactor" | "exploration" | "other";
|
|
27
|
+
/** Parsed intent (what user wants to accomplish) */
|
|
28
|
+
intent: string;
|
|
29
|
+
/** Context from user (files, variables, etc.) */
|
|
30
|
+
context: Record<string, unknown>;
|
|
31
|
+
/** Created timestamp */
|
|
32
|
+
createdAt: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Activity recommendation from backend
|
|
36
|
+
*/
|
|
37
|
+
export interface ActivityRecommendation {
|
|
38
|
+
/** Template ID to execute */
|
|
39
|
+
templateId: string;
|
|
40
|
+
/** Selection metadata from backend (Thompson Sampling) */
|
|
41
|
+
selectionMetadata: {
|
|
42
|
+
method: string;
|
|
43
|
+
alpha?: number;
|
|
44
|
+
beta?: number;
|
|
45
|
+
sample?: number;
|
|
46
|
+
score?: number;
|
|
47
|
+
};
|
|
48
|
+
/** Suggested variables for execution (derived from goal context) */
|
|
49
|
+
variables: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Goal execution result
|
|
53
|
+
*/
|
|
54
|
+
export interface GoalResult {
|
|
55
|
+
/** Goal that was executed */
|
|
56
|
+
goal: Goal;
|
|
57
|
+
/** Activities executed during goal pursuit */
|
|
58
|
+
executions: ActivityExecution[];
|
|
59
|
+
/** Whether goal was completed */
|
|
60
|
+
completed: boolean;
|
|
61
|
+
/** Completion reason */
|
|
62
|
+
completionReason: string;
|
|
63
|
+
/** Total duration in milliseconds */
|
|
64
|
+
totalDuration: number;
|
|
65
|
+
/** Total cost in dollars */
|
|
66
|
+
totalCost: number;
|
|
67
|
+
/** Total tokens used */
|
|
68
|
+
totalTokens: {
|
|
69
|
+
input: number;
|
|
70
|
+
output: number;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export declare class GoalProcessor {
|
|
74
|
+
private readonly workingDirectory;
|
|
75
|
+
private readonly executor;
|
|
76
|
+
constructor(config: {
|
|
77
|
+
workingDirectory: string;
|
|
78
|
+
executor: ActivityExecutor;
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Parse user goal message into structured Goal
|
|
82
|
+
*
|
|
83
|
+
* For now, simple parsing. Can be enhanced with LLM later.
|
|
84
|
+
*/
|
|
85
|
+
parseGoal(message: string, context?: Record<string, unknown>): Goal;
|
|
86
|
+
/**
|
|
87
|
+
* Get activity recommendations from backend API
|
|
88
|
+
*
|
|
89
|
+
* NOTE: This is a placeholder. In the real implementation, this will be called
|
|
90
|
+
* by opencode's MinibobIntegration which has access to MetabobCLI.recommendActivities().
|
|
91
|
+
*
|
|
92
|
+
* The backend recommendation engine:
|
|
93
|
+
* - Applies Thompson Sampling for exploration/exploitation
|
|
94
|
+
* - Considers historical execution success rates
|
|
95
|
+
* - Aligns recommendations with goal category
|
|
96
|
+
* - Uses impulse state for context-aware recommendations
|
|
97
|
+
*
|
|
98
|
+
* @param goal - Parsed goal
|
|
99
|
+
* @param loadedImpulseIds - IDs of currently loaded impulses
|
|
100
|
+
* @param limit - Max recommendations to return
|
|
101
|
+
* @returns Array of activity recommendations from backend
|
|
102
|
+
*/
|
|
103
|
+
getRecommendations(goal: Goal, loadedImpulseIds?: string[], limit?: number): Promise<ActivityRecommendation[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Assess relevance of a recommendation to the goal
|
|
106
|
+
*
|
|
107
|
+
* Uses simple keyword matching and semantic similarity to determine if
|
|
108
|
+
* the recommended activity is likely to help achieve the goal.
|
|
109
|
+
*
|
|
110
|
+
* @param goal - The goal being pursued
|
|
111
|
+
* @param recommendation - The activity recommendation
|
|
112
|
+
* @returns Relevance score from 0.0 (not relevant) to 1.0 (highly relevant)
|
|
113
|
+
*/
|
|
114
|
+
private assessRelevance;
|
|
115
|
+
/**
|
|
116
|
+
* Check if goal is complete based on executions
|
|
117
|
+
*
|
|
118
|
+
* With optional goal verification:
|
|
119
|
+
* - If last activity succeeded AND goal provided, verify achievement objectively
|
|
120
|
+
* - If last activity failed, goal is incomplete
|
|
121
|
+
* - Without goal, uses simple status check (backward compatibility)
|
|
122
|
+
*
|
|
123
|
+
* @param executions - Activity executions performed
|
|
124
|
+
* @param goal - Optional goal for objective verification
|
|
125
|
+
* @returns Completion status with reason
|
|
126
|
+
*/
|
|
127
|
+
isGoalComplete(executions: ActivityExecution[], goal?: Goal): {
|
|
128
|
+
complete: boolean;
|
|
129
|
+
reason: string;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Verify goal was actually achieved using objective criteria
|
|
133
|
+
* Prevents LLM hallucination where activity claims success but did nothing
|
|
134
|
+
*
|
|
135
|
+
* @param goal - The goal being evaluated
|
|
136
|
+
* @param executions - Activity executions performed
|
|
137
|
+
* @returns Verification result with reason
|
|
138
|
+
*/
|
|
139
|
+
private verifyGoalAchievement;
|
|
140
|
+
/**
|
|
141
|
+
* Create impulses from execution output for context propagation
|
|
142
|
+
*/
|
|
143
|
+
private createImpulsesFromExecution;
|
|
144
|
+
/**
|
|
145
|
+
* Execute goal-seeking process
|
|
146
|
+
*
|
|
147
|
+
* Main loop:
|
|
148
|
+
* 1. Parse goal
|
|
149
|
+
* 2. Get recommendations from backend (Thompson Sampling)
|
|
150
|
+
* 3. Execute top-ranked activity with context from previous steps
|
|
151
|
+
* 4. Create impulses from execution output
|
|
152
|
+
* 5. Check completion
|
|
153
|
+
* 6. Repeat until complete or max attempts
|
|
154
|
+
*
|
|
155
|
+
* @param message - User goal message
|
|
156
|
+
* @param context - Additional context (files, variables, etc.)
|
|
157
|
+
* @param options - Execution options
|
|
158
|
+
* @returns Goal execution result
|
|
159
|
+
*/
|
|
160
|
+
executeGoal(message: string, context?: Record<string, unknown>, options?: {
|
|
161
|
+
maxActivities?: number;
|
|
162
|
+
maxCost?: number;
|
|
163
|
+
}): Promise<GoalResult>;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=goal-processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-processor.d.ts","sourceRoot":"","sources":["../src/goal-processor.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
apiVersion: v2
|
|
2
|
+
name: minibob-cluster
|
|
3
|
+
description: Helm chart for deploying autonomous minibob vessel cluster
|
|
4
|
+
type: application
|
|
5
|
+
version: 0.1.0
|
|
6
|
+
appVersion: "0.1.0"
|
|
7
|
+
keywords:
|
|
8
|
+
- agent
|
|
9
|
+
- vessel
|
|
10
|
+
- autonomous
|
|
11
|
+
- metabob
|
|
12
|
+
maintainers:
|
|
13
|
+
- name: Metabob Team
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{{/*
|
|
2
|
+
Expand the name of the chart.
|
|
3
|
+
*/}}
|
|
4
|
+
{{- define "minibob-cluster.name" -}}
|
|
5
|
+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
6
|
+
{{- end }}
|
|
7
|
+
|
|
8
|
+
{{/*
|
|
9
|
+
Create a default fully qualified app name.
|
|
10
|
+
*/}}
|
|
11
|
+
{{- define "minibob-cluster.fullname" -}}
|
|
12
|
+
{{- if .Values.fullnameOverride }}
|
|
13
|
+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
14
|
+
{{- else }}
|
|
15
|
+
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
16
|
+
{{- if contains $name .Release.Name }}
|
|
17
|
+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
|
18
|
+
{{- else }}
|
|
19
|
+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
|
20
|
+
{{- end }}
|
|
21
|
+
{{- end }}
|
|
22
|
+
{{- end }}
|
|
23
|
+
|
|
24
|
+
{{/*
|
|
25
|
+
Create chart name and version as used by the chart label.
|
|
26
|
+
*/}}
|
|
27
|
+
{{- define "minibob-cluster.chart" -}}
|
|
28
|
+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
29
|
+
{{- end }}
|
|
30
|
+
|
|
31
|
+
{{/*
|
|
32
|
+
Common labels
|
|
33
|
+
*/}}
|
|
34
|
+
{{- define "minibob-cluster.labels" -}}
|
|
35
|
+
helm.sh/chart: {{ include "minibob-cluster.chart" . }}
|
|
36
|
+
{{ include "minibob-cluster.selectorLabels" . }}
|
|
37
|
+
{{- if .Chart.AppVersion }}
|
|
38
|
+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
39
|
+
{{- end }}
|
|
40
|
+
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
41
|
+
{{- end }}
|
|
42
|
+
|
|
43
|
+
{{/*
|
|
44
|
+
Selector labels
|
|
45
|
+
*/}}
|
|
46
|
+
{{- define "minibob-cluster.selectorLabels" -}}
|
|
47
|
+
app.kubernetes.io/name: {{ include "minibob-cluster.name" . }}
|
|
48
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
49
|
+
{{- end }}
|
|
50
|
+
|
|
51
|
+
{{/*
|
|
52
|
+
Create the name of the service account to use
|
|
53
|
+
*/}}
|
|
54
|
+
{{- define "minibob-cluster.serviceAccountName" -}}
|
|
55
|
+
{{- if .Values.serviceAccount.create }}
|
|
56
|
+
{{- default (include "minibob-cluster.fullname" .) .Values.serviceAccount.name }}
|
|
57
|
+
{{- else }}
|
|
58
|
+
{{- default "default" .Values.serviceAccount.name }}
|
|
59
|
+
{{- end }}
|
|
60
|
+
{{- end }}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{{- if .Values.configMap.create }}
|
|
2
|
+
apiVersion: v1
|
|
3
|
+
kind: ConfigMap
|
|
4
|
+
metadata:
|
|
5
|
+
name: {{ include "minibob-cluster.fullname" . }}-config
|
|
6
|
+
namespace: {{ .Release.Namespace }}
|
|
7
|
+
labels:
|
|
8
|
+
{{- include "minibob-cluster.labels" . | nindent 4 }}
|
|
9
|
+
data:
|
|
10
|
+
{{- toYaml .Values.configMap.data | nindent 2 }}
|
|
11
|
+
{{- end }}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: Deployment
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ include "minibob-cluster.fullname" . }}
|
|
5
|
+
namespace: {{ .Release.Namespace }}
|
|
6
|
+
labels:
|
|
7
|
+
{{- include "minibob-cluster.labels" . | nindent 4 }}
|
|
8
|
+
spec:
|
|
9
|
+
{{- if not .Values.autoscaling.enabled }}
|
|
10
|
+
replicas: {{ .Values.replicaCount }}
|
|
11
|
+
{{- end }}
|
|
12
|
+
selector:
|
|
13
|
+
matchLabels:
|
|
14
|
+
{{- include "minibob-cluster.selectorLabels" . | nindent 6 }}
|
|
15
|
+
template:
|
|
16
|
+
metadata:
|
|
17
|
+
{{- with .Values.podAnnotations }}
|
|
18
|
+
annotations:
|
|
19
|
+
{{- toYaml . | nindent 8 }}
|
|
20
|
+
{{- end }}
|
|
21
|
+
labels:
|
|
22
|
+
{{- include "minibob-cluster.selectorLabels" . | nindent 8 }}
|
|
23
|
+
spec:
|
|
24
|
+
{{- with .Values.imagePullSecrets }}
|
|
25
|
+
imagePullSecrets:
|
|
26
|
+
{{- toYaml . | nindent 8 }}
|
|
27
|
+
{{- end }}
|
|
28
|
+
securityContext:
|
|
29
|
+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
30
|
+
containers:
|
|
31
|
+
- name: {{ .Chart.Name }}
|
|
32
|
+
securityContext:
|
|
33
|
+
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
34
|
+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
|
35
|
+
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
36
|
+
ports:
|
|
37
|
+
- name: http
|
|
38
|
+
containerPort: {{ .Values.service.targetPort }}
|
|
39
|
+
protocol: TCP
|
|
40
|
+
env:
|
|
41
|
+
- name: ANTHROPIC_API_KEY
|
|
42
|
+
valueFrom:
|
|
43
|
+
secretKeyRef:
|
|
44
|
+
name: {{ include "minibob-cluster.fullname" . }}-secrets
|
|
45
|
+
key: anthropic-api-key
|
|
46
|
+
- name: MINIBOB_PORT
|
|
47
|
+
value: "{{ .Values.service.targetPort }}"
|
|
48
|
+
- name: MINIBOB_HOST
|
|
49
|
+
value: "0.0.0.0"
|
|
50
|
+
- name: MINIBOB_PROVIDER
|
|
51
|
+
value: "{{ .Values.minibob.provider }}"
|
|
52
|
+
- name: MINIBOB_MODEL
|
|
53
|
+
value: "{{ .Values.minibob.model }}"
|
|
54
|
+
- name: MCP_ENDPOINT
|
|
55
|
+
value: "{{ .Values.minibob.mcpEndpoint }}"
|
|
56
|
+
- name: MINIBOB_BOREDOM_ENABLED
|
|
57
|
+
value: "{{ .Values.minibob.boredom.enabled }}"
|
|
58
|
+
- name: MINIBOB_BOREDOM_POLL_INTERVAL
|
|
59
|
+
value: "{{ .Values.minibob.boredom.pollInterval }}"
|
|
60
|
+
- name: MINIBOB_BOREDOM_IDLE_THRESHOLD
|
|
61
|
+
value: "{{ .Values.minibob.boredom.idleThreshold }}"
|
|
62
|
+
- name: POD_NAME
|
|
63
|
+
valueFrom:
|
|
64
|
+
fieldRef:
|
|
65
|
+
fieldPath: metadata.name
|
|
66
|
+
- name: POD_NAMESPACE
|
|
67
|
+
valueFrom:
|
|
68
|
+
fieldRef:
|
|
69
|
+
fieldPath: metadata.namespace
|
|
70
|
+
- name: POD_IP
|
|
71
|
+
valueFrom:
|
|
72
|
+
fieldRef:
|
|
73
|
+
fieldPath: status.podIP
|
|
74
|
+
livenessProbe:
|
|
75
|
+
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
|
76
|
+
readinessProbe:
|
|
77
|
+
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
|
78
|
+
resources:
|
|
79
|
+
{{- toYaml .Values.resources | nindent 12 }}
|
|
80
|
+
volumeMounts:
|
|
81
|
+
- name: config
|
|
82
|
+
mountPath: /app/opencode.json
|
|
83
|
+
subPath: vessels.json
|
|
84
|
+
{{- if .Values.persistence.enabled }}
|
|
85
|
+
- name: workspace
|
|
86
|
+
mountPath: /workspace
|
|
87
|
+
{{- end }}
|
|
88
|
+
volumes:
|
|
89
|
+
- name: config
|
|
90
|
+
configMap:
|
|
91
|
+
name: {{ include "minibob-cluster.fullname" . }}-config
|
|
92
|
+
{{- if .Values.persistence.enabled }}
|
|
93
|
+
- name: workspace
|
|
94
|
+
persistentVolumeClaim:
|
|
95
|
+
claimName: {{ include "minibob-cluster.fullname" . }}-pvc
|
|
96
|
+
{{- end }}
|
|
97
|
+
{{- with .Values.nodeSelector }}
|
|
98
|
+
nodeSelector:
|
|
99
|
+
{{- toYaml . | nindent 8 }}
|
|
100
|
+
{{- end }}
|
|
101
|
+
{{- with .Values.affinity }}
|
|
102
|
+
affinity:
|
|
103
|
+
{{- toYaml . | nindent 8 }}
|
|
104
|
+
{{- end }}
|
|
105
|
+
{{- with .Values.tolerations }}
|
|
106
|
+
tolerations:
|
|
107
|
+
{{- toYaml . | nindent 8 }}
|
|
108
|
+
{{- end }}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Secret
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ include "minibob-cluster.fullname" . }}-secrets
|
|
5
|
+
namespace: {{ .Release.Namespace }}
|
|
6
|
+
labels:
|
|
7
|
+
{{- include "minibob-cluster.labels" . | nindent 4 }}
|
|
8
|
+
type: Opaque
|
|
9
|
+
stringData:
|
|
10
|
+
anthropic-api-key: {{ .Values.minibob.anthropicApiKey | required "minibob.anthropicApiKey is required" | quote }}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Service
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ include "minibob-cluster.fullname" . }}
|
|
5
|
+
namespace: {{ .Release.Namespace }}
|
|
6
|
+
labels:
|
|
7
|
+
{{- include "minibob-cluster.labels" . | nindent 4 }}
|
|
8
|
+
spec:
|
|
9
|
+
type: {{ .Values.service.type }}
|
|
10
|
+
ports:
|
|
11
|
+
- port: {{ .Values.service.port }}
|
|
12
|
+
targetPort: http
|
|
13
|
+
protocol: TCP
|
|
14
|
+
name: http
|
|
15
|
+
selector:
|
|
16
|
+
{{- include "minibob-cluster.selectorLabels" . | nindent 4 }}
|
|
17
|
+
---
|
|
18
|
+
{{- if .Values.service.headless.enabled }}
|
|
19
|
+
apiVersion: v1
|
|
20
|
+
kind: Service
|
|
21
|
+
metadata:
|
|
22
|
+
name: {{ include "minibob-cluster.fullname" . }}-headless
|
|
23
|
+
namespace: {{ .Release.Namespace }}
|
|
24
|
+
labels:
|
|
25
|
+
{{- include "minibob-cluster.labels" . | nindent 4 }}
|
|
26
|
+
service-type: headless
|
|
27
|
+
spec:
|
|
28
|
+
clusterIP: None
|
|
29
|
+
publishNotReadyAddresses: true
|
|
30
|
+
ports:
|
|
31
|
+
- port: {{ .Values.service.port }}
|
|
32
|
+
targetPort: http
|
|
33
|
+
protocol: TCP
|
|
34
|
+
name: http
|
|
35
|
+
selector:
|
|
36
|
+
{{- include "minibob-cluster.selectorLabels" . | nindent 4 }}
|
|
37
|
+
{{- end }}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Values for local development
|
|
2
|
+
# Uses local backend (port-forwarded or minikube)
|
|
3
|
+
|
|
4
|
+
replicaCount: 2
|
|
5
|
+
|
|
6
|
+
minibob:
|
|
7
|
+
anthropicApiKey: ""
|
|
8
|
+
|
|
9
|
+
# Local backend endpoint
|
|
10
|
+
# Note: For minikube/kind, use host.docker.internal or service name
|
|
11
|
+
mcpEndpoint: "http://api.metabob.local/mcp"
|
|
12
|
+
|
|
13
|
+
provider: "anthropic"
|
|
14
|
+
model: "claude-sonnet-4-20250514"
|
|
15
|
+
|
|
16
|
+
boredom:
|
|
17
|
+
enabled: true
|
|
18
|
+
pollInterval: 15000 # 15 seconds for faster local testing
|
|
19
|
+
idleThreshold: 30000 # 30 seconds for local
|
|
20
|
+
|
|
21
|
+
acp:
|
|
22
|
+
enabled: true
|
|
23
|
+
discoveryInterval: 30000
|
|
24
|
+
|
|
25
|
+
# Minimal resources for local
|
|
26
|
+
resources:
|
|
27
|
+
limits:
|
|
28
|
+
cpu: 500m
|
|
29
|
+
memory: 1Gi
|
|
30
|
+
requests:
|
|
31
|
+
cpu: 100m
|
|
32
|
+
memory: 256Mi
|
|
33
|
+
|
|
34
|
+
service:
|
|
35
|
+
type: NodePort # For easy access in local clusters
|
|
36
|
+
port: 8080
|
|
37
|
+
headless:
|
|
38
|
+
enabled: true
|
|
39
|
+
|
|
40
|
+
autoscaling:
|
|
41
|
+
enabled: false
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Values for production deployment
|
|
2
|
+
# Uses production backend
|
|
3
|
+
|
|
4
|
+
replicaCount: 5
|
|
5
|
+
|
|
6
|
+
minibob:
|
|
7
|
+
# API key MUST be set via --set or external secret
|
|
8
|
+
anthropicApiKey: ""
|
|
9
|
+
|
|
10
|
+
# Production backend endpoint
|
|
11
|
+
mcpEndpoint: "https://api.metabob.com/mcp"
|
|
12
|
+
|
|
13
|
+
provider: "anthropic"
|
|
14
|
+
model: "claude-sonnet-4-20250514"
|
|
15
|
+
|
|
16
|
+
boredom:
|
|
17
|
+
enabled: true
|
|
18
|
+
pollInterval: 60000 # 60 seconds for production
|
|
19
|
+
idleThreshold: 120000 # 120 seconds for production
|
|
20
|
+
|
|
21
|
+
acp:
|
|
22
|
+
enabled: true
|
|
23
|
+
discoveryInterval: 120000
|
|
24
|
+
|
|
25
|
+
# Production resources
|
|
26
|
+
resources:
|
|
27
|
+
limits:
|
|
28
|
+
cpu: 4000m
|
|
29
|
+
memory: 8Gi
|
|
30
|
+
requests:
|
|
31
|
+
cpu: 1000m
|
|
32
|
+
memory: 2Gi
|
|
33
|
+
|
|
34
|
+
service:
|
|
35
|
+
type: ClusterIP
|
|
36
|
+
port: 8080
|
|
37
|
+
headless:
|
|
38
|
+
enabled: true
|
|
39
|
+
|
|
40
|
+
# Enable autoscaling for production
|
|
41
|
+
autoscaling:
|
|
42
|
+
enabled: true
|
|
43
|
+
minReplicas: 5
|
|
44
|
+
maxReplicas: 20
|
|
45
|
+
targetCPUUtilizationPercentage: 70
|
|
46
|
+
|
|
47
|
+
# Production pod annotations
|
|
48
|
+
podAnnotations:
|
|
49
|
+
prometheus.io/scrape: "true"
|
|
50
|
+
prometheus.io/port: "8080"
|
|
51
|
+
prometheus.io/path: "/metrics"
|
|
52
|
+
|
|
53
|
+
# Enable monitoring
|
|
54
|
+
serviceMonitor:
|
|
55
|
+
enabled: true
|
|
56
|
+
interval: 30s
|
|
57
|
+
scrapeTimeout: 10s
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Values for testing-minibob namespace deployment
|
|
2
|
+
# Uses in-cluster backend service
|
|
3
|
+
|
|
4
|
+
replicaCount: 3
|
|
5
|
+
|
|
6
|
+
minibob:
|
|
7
|
+
# API key should be set via --set or secret
|
|
8
|
+
anthropicApiKey: ""
|
|
9
|
+
|
|
10
|
+
# In-cluster backend endpoint
|
|
11
|
+
mcpEndpoint: "http://metabob-rpc-api.metabob.svc.cluster.local:3000/mcp"
|
|
12
|
+
|
|
13
|
+
provider: "anthropic"
|
|
14
|
+
model: "claude-sonnet-4-20250514"
|
|
15
|
+
|
|
16
|
+
boredom:
|
|
17
|
+
enabled: true
|
|
18
|
+
pollInterval: 30000 # 30 seconds
|
|
19
|
+
idleThreshold: 60000 # 60 seconds
|
|
20
|
+
|
|
21
|
+
acp:
|
|
22
|
+
enabled: true
|
|
23
|
+
discoveryInterval: 60000
|
|
24
|
+
|
|
25
|
+
# Lower resources for testing
|
|
26
|
+
resources:
|
|
27
|
+
limits:
|
|
28
|
+
cpu: 1000m
|
|
29
|
+
memory: 2Gi
|
|
30
|
+
requests:
|
|
31
|
+
cpu: 250m
|
|
32
|
+
memory: 512Mi
|
|
33
|
+
|
|
34
|
+
# Enable headless service for ACP discovery
|
|
35
|
+
service:
|
|
36
|
+
type: ClusterIP
|
|
37
|
+
port: 8080
|
|
38
|
+
headless:
|
|
39
|
+
enabled: true
|
|
40
|
+
|
|
41
|
+
# Enable autoscaling for testing
|
|
42
|
+
autoscaling:
|
|
43
|
+
enabled: false
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Default values for minibob-cluster
|
|
2
|
+
replicaCount: 3
|
|
3
|
+
|
|
4
|
+
image:
|
|
5
|
+
repository: minibob
|
|
6
|
+
pullPolicy: IfNotPresent
|
|
7
|
+
tag: "latest"
|
|
8
|
+
|
|
9
|
+
imagePullSecrets: []
|
|
10
|
+
nameOverride: ""
|
|
11
|
+
fullnameOverride: ""
|
|
12
|
+
|
|
13
|
+
# minibob configuration
|
|
14
|
+
minibob:
|
|
15
|
+
# API keys (should be provided via secrets in production)
|
|
16
|
+
anthropicApiKey: "" # Set via --set or secrets
|
|
17
|
+
|
|
18
|
+
# MCP backend endpoint
|
|
19
|
+
# Options:
|
|
20
|
+
# In-cluster: "http://metabob-rpc-api.metabob.svc.cluster.local:3000/mcp"
|
|
21
|
+
# Production: "https://api.metabob.com/mcp"
|
|
22
|
+
# Local: "http://api.metabob.local/mcp"
|
|
23
|
+
mcpEndpoint: "http://metabob-rpc-api.metabob.svc.cluster.local:3000/mcp"
|
|
24
|
+
|
|
25
|
+
# LLM configuration
|
|
26
|
+
provider: "anthropic"
|
|
27
|
+
model: "claude-sonnet-4-20250514"
|
|
28
|
+
|
|
29
|
+
# Boredom task configuration
|
|
30
|
+
boredom:
|
|
31
|
+
enabled: true
|
|
32
|
+
pollInterval: 30000 # 30 seconds
|
|
33
|
+
idleThreshold: 60000 # 60 seconds
|
|
34
|
+
|
|
35
|
+
# ACP gossip configuration
|
|
36
|
+
acp:
|
|
37
|
+
enabled: true
|
|
38
|
+
discoveryInterval: 60000 # 60 seconds
|
|
39
|
+
|
|
40
|
+
# Vessel capabilities
|
|
41
|
+
capabilities:
|
|
42
|
+
- activities
|
|
43
|
+
- impulses
|
|
44
|
+
- git
|
|
45
|
+
- acp-gossip
|
|
46
|
+
- boredom
|
|
47
|
+
- trailblazing
|
|
48
|
+
- learning
|
|
49
|
+
|
|
50
|
+
service:
|
|
51
|
+
type: ClusterIP
|
|
52
|
+
port: 8080
|
|
53
|
+
targetPort: 8080
|
|
54
|
+
|
|
55
|
+
# Headless service for vessel discovery
|
|
56
|
+
headless:
|
|
57
|
+
enabled: true
|
|
58
|
+
|
|
59
|
+
# Resource limits
|
|
60
|
+
resources:
|
|
61
|
+
limits:
|
|
62
|
+
cpu: 2000m
|
|
63
|
+
memory: 4Gi
|
|
64
|
+
requests:
|
|
65
|
+
cpu: 500m
|
|
66
|
+
memory: 1Gi
|
|
67
|
+
|
|
68
|
+
# Autoscaling
|
|
69
|
+
autoscaling:
|
|
70
|
+
enabled: false
|
|
71
|
+
minReplicas: 2
|
|
72
|
+
maxReplicas: 10
|
|
73
|
+
targetCPUUtilizationPercentage: 80
|
|
74
|
+
|
|
75
|
+
# Pod configuration
|
|
76
|
+
podAnnotations: {}
|
|
77
|
+
podSecurityContext: {}
|
|
78
|
+
securityContext: {}
|
|
79
|
+
|
|
80
|
+
nodeSelector: {}
|
|
81
|
+
tolerations: []
|
|
82
|
+
affinity: {}
|
|
83
|
+
|
|
84
|
+
# Liveness and readiness probes
|
|
85
|
+
livenessProbe:
|
|
86
|
+
httpGet:
|
|
87
|
+
path: /health
|
|
88
|
+
port: http
|
|
89
|
+
initialDelaySeconds: 30
|
|
90
|
+
periodSeconds: 10
|
|
91
|
+
timeoutSeconds: 5
|
|
92
|
+
failureThreshold: 3
|
|
93
|
+
|
|
94
|
+
readinessProbe:
|
|
95
|
+
httpGet:
|
|
96
|
+
path: /health
|
|
97
|
+
port: http
|
|
98
|
+
initialDelaySeconds: 10
|
|
99
|
+
periodSeconds: 5
|
|
100
|
+
timeoutSeconds: 3
|
|
101
|
+
failureThreshold: 3
|
|
102
|
+
|
|
103
|
+
# Service monitor for Prometheus (optional)
|
|
104
|
+
serviceMonitor:
|
|
105
|
+
enabled: false
|
|
106
|
+
interval: 30s
|
|
107
|
+
scrapeTimeout: 10s
|
|
108
|
+
|
|
109
|
+
# ConfigMap for vessel configuration
|
|
110
|
+
configMap:
|
|
111
|
+
create: true
|
|
112
|
+
data:
|
|
113
|
+
vessels.json: |
|
|
114
|
+
{
|
|
115
|
+
"metabob": {
|
|
116
|
+
"type": "mcp",
|
|
117
|
+
"endpoint": "http://api.metabob.local/mcp",
|
|
118
|
+
"capabilities": ["activities", "impulses", "git", "acp-gossip", "boredom"]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
# Persistent storage (optional, for git operations)
|
|
123
|
+
persistence:
|
|
124
|
+
enabled: false
|
|
125
|
+
storageClass: ""
|
|
126
|
+
accessMode: ReadWriteOnce
|
|
127
|
+
size: 10Gi
|