hyperforge 1.0.0.post302__tar.gz → 1.0.0.post312__tar.gz
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.
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/PKG-INFO +1 -1
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/pyproject.toml +1 -1
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/pyproject.toml.orig +1 -1
- hyperforge-1.0.0.post312/src/hyperforge/harness_sdk/context.py +96 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/core.py +18 -4
- hyperforge-1.0.0.post302/src/hyperforge/harness_sdk/context.py +0 -74
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/README.md +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/VERSION +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/agent.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/README +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/env.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/script.py.mako +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/049a4aed19e1_create_generation_table.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/1416cb41bd49_add_downloads_table.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/2847934e2d59_unique_driver.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/4d89a36c8bda_memory.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/72b997edb05d_identifier_for_drivers.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/9c6f6a1b4e7f_workflows_default_fk.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/b8edb72295e0_.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic/versions/f3d2c1b0a9e8_soft_delete_workflows.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/alembic.ini +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/app.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/authentication.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/commands.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/logging.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/models.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/session.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/settings.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/utils.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/agents.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/interaction.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/mcp_content.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/mcp_interaction.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/oauth.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/prompt.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/router.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/schema.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/session.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/utils.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/workflows.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/arag.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/broker/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/broker/local.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/broker/redis.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/codemode/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/codemode/model.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/codemode/sandbox.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/codemode/worker.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/configure.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/context/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/context/agent.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/context/config.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/database.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/agents.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/encryption.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/exceptions.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/llm_migration_utils.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/settings.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/workflow_cleanup.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/definition.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/driver.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/dummy.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/engine.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/exceptions.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/feature_flag.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/fixtures.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness/agent.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness/config.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/agents.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/clients.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/harness.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/models.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/schema.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/storage.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/codemode.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/utils.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/usage.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/interaction.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/llm.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/llm_config.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/manager.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/memory/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/memory/memory.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/minimal_fixtures.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/models.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/openapi.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/prompts.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/pubsub.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/py.typed +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/redis_utils.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/result_payload.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/retrieval/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/retrieval/agent.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/retrieval/config.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/cache.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/run.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/sandbox.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/session.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/settings.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/utils.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/server/web.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/settings.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/agent.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/app.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/config.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/const.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/oauth.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/run.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/settings.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/ui_router.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/static/assets/index-DLejS5jC.js +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/static/assets/index-MoxkZ1_3.css +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/static/favicon.svg +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/static/index.html +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/trace.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/utils/__init__.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/utils/http.py +0 -0
- {hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/workflows.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hyperforge"
|
|
7
|
-
version = "1.0.0.
|
|
7
|
+
version = "1.0.0.post312"
|
|
8
8
|
authors = [{ name = "AI Data Team", email = "learning@nuclia.com" }]
|
|
9
9
|
description = "Agentic Framework for Orchestrated Runtime, Governance, and Execution"
|
|
10
10
|
readme = "README.md"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Any, Callable, TypeVar
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict
|
|
8
|
+
|
|
9
|
+
from .models import HarnessContextReference, HarnessContextType
|
|
10
|
+
|
|
11
|
+
ContextModelT = TypeVar("ContextModelT", bound=BaseModel)
|
|
12
|
+
type ContextFormatter = Callable[[Any], str]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True)
|
|
16
|
+
class ContextDefinition:
|
|
17
|
+
schema: type[BaseModel]
|
|
18
|
+
formatter: ContextFormatter | None = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
_DEFINITIONS: dict[HarnessContextType, ContextDefinition] = {}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class RetrievalContext(BaseModel):
|
|
25
|
+
model_config = ConfigDict(extra="allow")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def register_context(
|
|
29
|
+
context_type: HarnessContextType,
|
|
30
|
+
schema: type[ContextModelT],
|
|
31
|
+
) -> Callable[[Callable[[ContextModelT], str]], Callable[[ContextModelT], str]]:
|
|
32
|
+
def decorator(
|
|
33
|
+
formatter: Callable[[ContextModelT], str],
|
|
34
|
+
) -> Callable[[ContextModelT], str]:
|
|
35
|
+
_DEFINITIONS[context_type] = ContextDefinition(
|
|
36
|
+
schema=schema, formatter=formatter
|
|
37
|
+
)
|
|
38
|
+
return formatter
|
|
39
|
+
|
|
40
|
+
return decorator
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@register_context(HarnessContextType.RETRIEVAL, RetrievalContext)
|
|
44
|
+
def _format_retrieval_context(context: RetrievalContext) -> str:
|
|
45
|
+
content = {
|
|
46
|
+
key: (
|
|
47
|
+
[
|
|
48
|
+
{
|
|
49
|
+
item_key: item_value
|
|
50
|
+
for item_key, item_value in item.items()
|
|
51
|
+
if item_key not in {"images"}
|
|
52
|
+
and item_value not in (None, "", [], {})
|
|
53
|
+
}
|
|
54
|
+
for item in value
|
|
55
|
+
]
|
|
56
|
+
if key == "items" and isinstance(value, list)
|
|
57
|
+
else value
|
|
58
|
+
)
|
|
59
|
+
for key, value in context.model_dump(mode="json").items()
|
|
60
|
+
if key not in {"images"} and value not in (None, "", [], {})
|
|
61
|
+
}
|
|
62
|
+
return json.dumps(content, sort_keys=True, default=str, separators=(",", ":"))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def make_context(
|
|
66
|
+
context_type: HarnessContextType, output: BaseModel
|
|
67
|
+
) -> HarnessContextReference:
|
|
68
|
+
definition = _DEFINITIONS.get(context_type)
|
|
69
|
+
if definition is None:
|
|
70
|
+
return HarnessContextReference(
|
|
71
|
+
type=context_type, content=output.model_dump(mode="json")
|
|
72
|
+
)
|
|
73
|
+
value = definition.schema.model_validate(output.model_dump(mode="json"))
|
|
74
|
+
return HarnessContextReference(
|
|
75
|
+
type=context_type, content=value.model_dump(mode="json")
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def format_context(reference: HarnessContextReference) -> str:
|
|
80
|
+
definition = _DEFINITIONS.get(reference.type)
|
|
81
|
+
content = reference.content
|
|
82
|
+
if definition is not None:
|
|
83
|
+
value = definition.schema.model_validate(content)
|
|
84
|
+
if definition.formatter is not None:
|
|
85
|
+
return definition.formatter(value)
|
|
86
|
+
content = value.model_dump(mode="json")
|
|
87
|
+
return json.dumps(
|
|
88
|
+
content,
|
|
89
|
+
sort_keys=True,
|
|
90
|
+
default=str,
|
|
91
|
+
separators=(",", ":"),
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def context_schema(context_type: HarnessContextType) -> dict[str, Any]:
|
|
96
|
+
return _DEFINITIONS[context_type].schema.model_json_schema()
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/core.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import uuid
|
|
4
|
+
from re import findall
|
|
4
5
|
from typing import TYPE_CHECKING, Any
|
|
5
6
|
|
|
6
7
|
from pydantic import BaseModel
|
|
@@ -64,19 +65,32 @@ class ListOutput(BaseModel):
|
|
|
64
65
|
items: list[dict[str, Any]]
|
|
65
66
|
|
|
66
67
|
|
|
68
|
+
_SEARCH_STOP_WORDS = {"a", "an", "and", "for", "or", "the", "to"}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _search_terms(value: str) -> set[str]:
|
|
72
|
+
return {
|
|
73
|
+
term
|
|
74
|
+
for term in findall(r"[\w]+", value.casefold().replace("_", " "))
|
|
75
|
+
if term not in _SEARCH_STOP_WORDS
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
67
79
|
@tool(description="Search for additional tools that can be activated.")
|
|
68
80
|
async def search_tools(
|
|
69
81
|
harness: AgentHarness, input_value: SearchToolsInput
|
|
70
82
|
) -> ListOutput:
|
|
71
|
-
terms = input_value.query
|
|
83
|
+
terms = _search_terms(input_value.query)
|
|
72
84
|
candidates: list[tuple[int, HarnessTool[Any, Any]]] = []
|
|
73
85
|
for candidate in harness._external_tools:
|
|
74
86
|
if not candidate.lazy_load or candidate.name in harness._active_lazy_tools:
|
|
75
87
|
continue
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
name_terms = _search_terms(candidate.name)
|
|
89
|
+
searchable_terms = name_terms | _search_terms(candidate.description)
|
|
90
|
+
matching_terms = terms & searchable_terms
|
|
91
|
+
if terms and not matching_terms:
|
|
78
92
|
continue
|
|
79
|
-
score = sum(2 if term in
|
|
93
|
+
score = sum(2 if term in name_terms else 1 for term in matching_terms)
|
|
80
94
|
candidates.append((score, candidate))
|
|
81
95
|
candidates.sort(key=lambda item: (-item[0], item[1].name))
|
|
82
96
|
limit = max(1, min(input_value.limit, 50))
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
from typing import Any, Callable
|
|
6
|
-
|
|
7
|
-
from pydantic import BaseModel
|
|
8
|
-
|
|
9
|
-
from .models import HarnessContextReference, HarnessContextType
|
|
10
|
-
|
|
11
|
-
type ContextFormatter = Callable[[BaseModel], str]
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@dataclass(frozen=True)
|
|
15
|
-
class ContextDefinition:
|
|
16
|
-
schema: type[BaseModel]
|
|
17
|
-
formatter: ContextFormatter | None = None
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_DEFINITIONS: dict[HarnessContextType, ContextDefinition] = {}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def register_context(
|
|
24
|
-
context_type: HarnessContextType,
|
|
25
|
-
schema: type[BaseModel],
|
|
26
|
-
formatter: ContextFormatter | None = None,
|
|
27
|
-
) -> None:
|
|
28
|
-
_DEFINITIONS[context_type] = ContextDefinition(schema=schema, formatter=formatter)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def make_context(
|
|
32
|
-
context_type: HarnessContextType, output: BaseModel
|
|
33
|
-
) -> HarnessContextReference:
|
|
34
|
-
definition = _DEFINITIONS.get(context_type)
|
|
35
|
-
if definition is None:
|
|
36
|
-
return HarnessContextReference(
|
|
37
|
-
type=context_type, content=output.model_dump(mode="json")
|
|
38
|
-
)
|
|
39
|
-
value = definition.schema.model_validate(output.model_dump(mode="json"))
|
|
40
|
-
return HarnessContextReference(
|
|
41
|
-
type=context_type, content=value.model_dump(mode="json")
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def format_context(reference: HarnessContextReference) -> str:
|
|
46
|
-
if reference.type == HarnessContextType.RETRIEVAL:
|
|
47
|
-
values = reference.content.get("items", [reference.content])
|
|
48
|
-
visible = [
|
|
49
|
-
{
|
|
50
|
-
key: value
|
|
51
|
-
for key, value in item.items()
|
|
52
|
-
if key not in {"images"} and value not in (None, "", [], {})
|
|
53
|
-
}
|
|
54
|
-
for item in values
|
|
55
|
-
]
|
|
56
|
-
return json.dumps(visible, sort_keys=True, default=str, separators=(",", ":"))
|
|
57
|
-
definition = _DEFINITIONS.get(reference.type)
|
|
58
|
-
if definition is None:
|
|
59
|
-
return json.dumps(
|
|
60
|
-
reference.content, sort_keys=True, default=str, separators=(",", ":")
|
|
61
|
-
)
|
|
62
|
-
value = definition.schema.model_validate(reference.content)
|
|
63
|
-
if definition.formatter is not None:
|
|
64
|
-
return definition.formatter(value)
|
|
65
|
-
return json.dumps(
|
|
66
|
-
value.model_dump(mode="json"),
|
|
67
|
-
sort_keys=True,
|
|
68
|
-
default=str,
|
|
69
|
-
separators=(",", ":"),
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def context_schema(context_type: HarnessContextType) -> dict[str, Any]:
|
|
74
|
-
return _DEFINITIONS[context_type].schema.model_json_schema()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/api/v1/mcp_interaction.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/db/llm_migration_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/__init__.py
RENAMED
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/codemode.py
RENAMED
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/harness_sdk/tools/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/standalone/ui_router.py
RENAMED
|
File without changes
|
{hyperforge-1.0.0.post302 → hyperforge-1.0.0.post312}/src/hyperforge/static/assets/index-DLejS5jC.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|