@tokensmind/agent-network 0.1.0 → 0.1.3
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 +81 -7
- package/openclaw.plugin.json +2 -2
- package/package.json +18 -8
- package/skills/tokensmind-agent-network/SKILL.md +145 -0
- package/skills/tokensmind-agent-network/package.json +4 -0
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/action_support.py +3 -1
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/agent_network_runtime.py +61 -9
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/action-executor.js +12 -1
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/action-validation.js +5 -0
- package/skills/tokensmind-agent-network/scripts/lib/agent-actions.js +91 -0
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/api-client.js +14 -2
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/contact-action.js +1 -1
- package/skills/tokensmind-agent-network/scripts/lib/memory-actions.js +112 -0
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/connector.js +8 -19
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/credentialStore.js +60 -11
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/requestPolicy.js +0 -11
- package/skills/tokensmind-agent-network/scripts/lib/runtime/systemCredentialStore.js +245 -0
- package/skills/tokensmind-agent-network/scripts/lib/runtime/systemCredentialSupport.js +71 -0
- package/skills/tokensmind-agent-network/scripts/memory_actions.py +131 -0
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/connector.py +8 -8
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/credential_store.py +56 -12
- package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/request_policy.py +1 -13
- package/skills/tokensmind-agent-network/scripts/python_runtime/system_credential_store.py +250 -0
- package/src/action-executor.js +12 -1
- package/src/action-validation.js +5 -0
- package/src/agent-actions.js +53 -6
- package/src/api-client.js +14 -2
- package/src/contact-action.js +1 -1
- package/src/index.js +4 -2
- package/src/memory-actions.js +112 -0
- package/src/runtime/connector.js +8 -19
- package/src/runtime/credentialStore.js +60 -11
- package/src/runtime/requestPolicy.js +0 -11
- package/src/runtime/systemCredentialStore.js +143 -74
- package/src/runtime/systemCredentialSupport.js +71 -0
- package/skills/tokensmind-agent-network-runtime/SKILL.md +0 -55
- package/skills/tokensmind-agent-network-runtime/scripts/lib/agent-actions.js +0 -44
- package/skills/tokensmind-agent-network-runtime/scripts/lib/runtime/systemCredentialStore.js +0 -176
- package/skills/tokensmind-agent-network-runtime/scripts/python_runtime/system_credential_store.py +0 -143
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/action_executor.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/action_validation.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/agent-network-runtime.mjs +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/governance_actions.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/action-context.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/action-errors.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/governance-actions.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/messaging-actions.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/browser.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/constants.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/crypto.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/deviceAuthorization.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/httpClient.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/runtime/portableStore.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/lib/workflow-store.js +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/__init__.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/browser.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/constants.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/crypto.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/device_authorization.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/errors.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/http_client.py +0 -0
- /package/skills/{tokensmind-agent-network-runtime → tokensmind-agent-network}/scripts/python_runtime/portable_store.py +0 -0
package/skills/tokensmind-agent-network-runtime/scripts/python_runtime/system_credential_store.py
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import os
|
|
3
|
-
import shutil
|
|
4
|
-
import subprocess
|
|
5
|
-
|
|
6
|
-
from .portable_store import RECORD_NAMES, _validate_record
|
|
7
|
-
|
|
8
|
-
SERVICE_NAME = "TokensMind Agent Network"
|
|
9
|
-
APPLICATION_NAME = "tokensmind-agent-network"
|
|
10
|
-
MACOS_SECURITY_PATH = "/usr/bin/security"
|
|
11
|
-
MACOS_ITEM_NOT_FOUND = 44
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def _validate_record_name(name):
|
|
15
|
-
if name not in RECORD_NAMES:
|
|
16
|
-
raise ValueError("Unsupported portable state record: %s" % name)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def _parse_record(name, source):
|
|
20
|
-
try:
|
|
21
|
-
value = json.loads(source)
|
|
22
|
-
except json.JSONDecodeError as error:
|
|
23
|
-
raise ValueError(
|
|
24
|
-
"System Agent Network %s credential is invalid JSON" % name,
|
|
25
|
-
) from error
|
|
26
|
-
_validate_record(name, value)
|
|
27
|
-
return value
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def _command_failure(backend, operation, result):
|
|
31
|
-
return RuntimeError(
|
|
32
|
-
"%s %s failed with exit code %s" % (backend, operation, result.returncode),
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def run_credential_command(args, input_text=""):
|
|
37
|
-
return subprocess.run(
|
|
38
|
-
args,
|
|
39
|
-
input=input_text,
|
|
40
|
-
text=True,
|
|
41
|
-
stdout=subprocess.PIPE,
|
|
42
|
-
stderr=subprocess.PIPE,
|
|
43
|
-
check=False,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class MacOSCredentialStore:
|
|
48
|
-
def __init__(self, namespace, runner=run_credential_command):
|
|
49
|
-
self._namespace = namespace
|
|
50
|
-
self._runner = runner
|
|
51
|
-
|
|
52
|
-
def _account(self, name):
|
|
53
|
-
_validate_record_name(name)
|
|
54
|
-
return "%s:%s" % (self._namespace, name)
|
|
55
|
-
|
|
56
|
-
def read(self, name):
|
|
57
|
-
result = self._runner([
|
|
58
|
-
MACOS_SECURITY_PATH, "find-generic-password",
|
|
59
|
-
"-a", self._account(name), "-s", SERVICE_NAME, "-w",
|
|
60
|
-
])
|
|
61
|
-
if result.returncode == MACOS_ITEM_NOT_FOUND:
|
|
62
|
-
return None
|
|
63
|
-
if result.returncode != 0:
|
|
64
|
-
raise _command_failure("macOS Keychain", "read", result)
|
|
65
|
-
return _parse_record(name, result.stdout.strip())
|
|
66
|
-
|
|
67
|
-
def write(self, name, value):
|
|
68
|
-
_validate_record(name, value)
|
|
69
|
-
result = self._runner([
|
|
70
|
-
MACOS_SECURITY_PATH, "add-generic-password",
|
|
71
|
-
"-a", self._account(name), "-s", SERVICE_NAME, "-U", "-w",
|
|
72
|
-
], json.dumps(value, separators=(",", ":")) + "\n")
|
|
73
|
-
if result.returncode != 0:
|
|
74
|
-
raise _command_failure("macOS Keychain", "write", result)
|
|
75
|
-
|
|
76
|
-
def remove(self, name):
|
|
77
|
-
result = self._runner([
|
|
78
|
-
MACOS_SECURITY_PATH, "delete-generic-password",
|
|
79
|
-
"-a", self._account(name), "-s", SERVICE_NAME,
|
|
80
|
-
])
|
|
81
|
-
if result.returncode not in (0, MACOS_ITEM_NOT_FOUND):
|
|
82
|
-
raise _command_failure("macOS Keychain", "remove", result)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class LinuxSecretServiceStore:
|
|
86
|
-
def __init__(self, namespace, command, runner=run_credential_command):
|
|
87
|
-
self._namespace = namespace
|
|
88
|
-
self._command = command
|
|
89
|
-
self._runner = runner
|
|
90
|
-
|
|
91
|
-
def _attributes(self, name):
|
|
92
|
-
_validate_record_name(name)
|
|
93
|
-
return [
|
|
94
|
-
"application", APPLICATION_NAME,
|
|
95
|
-
"origin", self._namespace,
|
|
96
|
-
"record", name,
|
|
97
|
-
]
|
|
98
|
-
|
|
99
|
-
def read(self, name):
|
|
100
|
-
result = self._runner([self._command, "lookup"] + self._attributes(name))
|
|
101
|
-
missing = (
|
|
102
|
-
result.returncode == 1
|
|
103
|
-
and not result.stdout.strip()
|
|
104
|
-
and not result.stderr.strip()
|
|
105
|
-
)
|
|
106
|
-
if missing:
|
|
107
|
-
return None
|
|
108
|
-
if result.returncode != 0:
|
|
109
|
-
raise _command_failure("Linux Secret Service", "read", result)
|
|
110
|
-
return _parse_record(name, result.stdout.strip())
|
|
111
|
-
|
|
112
|
-
def write(self, name, value):
|
|
113
|
-
_validate_record(name, value)
|
|
114
|
-
result = self._runner(
|
|
115
|
-
[self._command, "store", "--label=%s" % SERVICE_NAME]
|
|
116
|
-
+ self._attributes(name),
|
|
117
|
-
json.dumps(value, separators=(",", ":")) + "\n",
|
|
118
|
-
)
|
|
119
|
-
if result.returncode != 0:
|
|
120
|
-
raise _command_failure("Linux Secret Service", "write", result)
|
|
121
|
-
|
|
122
|
-
def remove(self, name):
|
|
123
|
-
if self.read(name) is None:
|
|
124
|
-
return
|
|
125
|
-
result = self._runner([self._command, "clear"] + self._attributes(name))
|
|
126
|
-
if result.returncode != 0:
|
|
127
|
-
raise _command_failure("Linux Secret Service", "remove", result)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def resolve_system_credential_store(
|
|
131
|
-
platform, namespace, env=None, *, runner=run_credential_command):
|
|
132
|
-
if platform == "darwin":
|
|
133
|
-
if not os.path.isfile(MACOS_SECURITY_PATH):
|
|
134
|
-
return None
|
|
135
|
-
if not os.access(MACOS_SECURITY_PATH, os.X_OK):
|
|
136
|
-
return None
|
|
137
|
-
return MacOSCredentialStore(namespace, runner)
|
|
138
|
-
if platform == "linux":
|
|
139
|
-
environment = os.environ if env is None else env
|
|
140
|
-
command = shutil.which("secret-tool", path=environment.get("PATH"))
|
|
141
|
-
if command:
|
|
142
|
-
return LinuxSecretServiceStore(namespace, command, runner)
|
|
143
|
-
return None
|
|
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
|