-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add Jungian Intelligence Layer service v3.2.0 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| package pluggedinkit | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "net/url" | ||
| ) | ||
|
|
||
| // JungianService handles Jungian Intelligence Layer operations | ||
| type JungianService struct { | ||
| client *Client | ||
| } | ||
|
|
||
| // SearchWithContext performs an archetype-enhanced memory search | ||
| func (s *JungianService) SearchWithContext(ctx context.Context, query string, toolName string, outcome string) (*ArchetypeSearchResponse, error) { | ||
| body := map[string]interface{}{ | ||
| "query": query, | ||
| "tool_name": toolName, | ||
| "outcome": outcome, | ||
| } | ||
| var result ArchetypeSearchResponse | ||
| err := s.client.post(ctx, "/api/memory/archetype/inject", body, &result) | ||
| return &result, err | ||
| } | ||
|
|
||
| // GetIndividuationScore returns the current individuation score | ||
| func (s *JungianService) GetIndividuationScore(ctx context.Context) (*IndividuationResponse, error) { | ||
| var result IndividuationResponse | ||
| err := s.client.get(ctx, "/api/memory/individuation", &result) | ||
| return &result, err | ||
| } | ||
|
|
||
| // GetIndividuationHistory returns daily score snapshots for the specified number of days | ||
| func (s *JungianService) GetIndividuationHistory(ctx context.Context, days int) ([]IndividuationResponse, error) { | ||
| params := url.Values{} | ||
| params.Set("history", "true") | ||
| params.Set("days", fmt.Sprintf("%d", days)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| path := fmt.Sprintf("/api/memory/individuation?%s", params.Encode()) | ||
|
|
||
| var result []IndividuationResponse | ||
| err := s.client.get(ctx, path, &result) | ||
| return result, err | ||
| } | ||
|
|
||
| // GetSynchronicityPatterns returns detected synchronicity patterns | ||
| func (s *JungianService) GetSynchronicityPatterns(ctx context.Context) ([]SynchronicityPattern, error) { | ||
| var result []SynchronicityPattern | ||
| err := s.client.get(ctx, "/api/memory/sync/patterns", &result) | ||
| return result, err | ||
| } | ||
|
|
||
| // GetDreamHistory returns dream consolidation records | ||
| func (s *JungianService) GetDreamHistory(ctx context.Context) ([]DreamConsolidation, error) { | ||
| var result []DreamConsolidation | ||
| err := s.client.get(ctx, "/api/memory/dream/history", &result) | ||
| return result, err | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -331,3 +331,58 @@ type ClipboardDeleteResponse struct { | |||||
| Deleted bool `json:"deleted,omitempty"` | ||||||
| Error string `json:"error,omitempty"` | ||||||
| } | ||||||
|
|
||||||
| // --- Jungian Intelligence --- | ||||||
|
|
||||||
| // IndividuationComponents represents the breakdown of an individuation score | ||||||
| type IndividuationComponents struct { | ||||||
| MemoryDepth int `json:"memoryDepth"` | ||||||
| LearningVelocity int `json:"learningVelocity"` | ||||||
| CollectiveContribution int `json:"collectiveContribution"` | ||||||
| SelfAwareness int `json:"selfAwareness"` | ||||||
| } | ||||||
|
|
||||||
| // IndividuationResponse represents the individuation score and metadata | ||||||
| type IndividuationResponse struct { | ||||||
| Total int `json:"total"` | ||||||
| Level string `json:"level"` | ||||||
| WeeklyTrend string `json:"weeklyTrend"` | ||||||
| Tip string `json:"tip"` | ||||||
| Components IndividuationComponents `json:"components"` | ||||||
| } | ||||||
|
|
||||||
| // ArchetypedPattern represents a memory pattern with archetype metadata | ||||||
| type ArchetypedPattern struct { | ||||||
| UUID string `json:"uuid"` | ||||||
| Archetype string `json:"archetype"` | ||||||
| ArchetypeLabel string `json:"archetypeLabel"` | ||||||
| ArchetypeWeight float64 `json:"archetypeWeight"` | ||||||
| PatternType string `json:"patternType"` | ||||||
| Description string `json:"description"` | ||||||
| Pattern string `json:"pattern"` | ||||||
| Confidence float64 `json:"confidence"` | ||||||
| Similarity float64 `json:"similarity"` | ||||||
| } | ||||||
|
|
||||||
| // ArchetypeSearchResponse represents the response from an archetype-enhanced search | ||||||
| type ArchetypeSearchResponse struct { | ||||||
| Patterns []ArchetypedPattern `json:"patterns"` | ||||||
| } | ||||||
|
|
||||||
| // SynchronicityPattern represents a detected synchronicity pattern | ||||||
| type SynchronicityPattern struct { | ||||||
| UUID string `json:"uuid"` | ||||||
| PatternType string `json:"patternType"` | ||||||
| Description string `json:"description"` | ||||||
| Confidence float64 `json:"confidence"` | ||||||
| UniqueProfiles int `json:"uniqueProfiles"` | ||||||
| } | ||||||
|
|
||||||
| // DreamConsolidation represents a dream consolidation record | ||||||
| type DreamConsolidation struct { | ||||||
| UUID string `json:"uuid"` | ||||||
| SourceCount int `json:"sourceCount"` | ||||||
| TokenSavings int `json:"tokenSavings"` | ||||||
| ClusterSimilarity float64 `json:"clusterSimilarity"` | ||||||
| CreatedAt string `json:"createdAt"` | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For improved type safety and readability, consider using a struct for the request body instead of
map[string]interface{}. This makes the request structure explicit and less error-prone. You could use an anonymous struct here: