llm-function 0.0.1__py3-none-any.whl
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.
- llm_function/.paa.tracking/.paa.config +12 -0
- llm_function/.paa.tracking/.paa.version +1 -0
- llm_function/.paa.tracking/git/dependencies/llm_func_deps/llm_function_config.py +35 -0
- llm_function/.paa.tracking/git/dependencies/llm_func_deps/tool_registry.py +250 -0
- llm_function/.paa.tracking/git/docs_cache/llm_function.md +0 -0
- llm_function/.paa.tracking/git/module/llm_function.py +250 -0
- llm_function/.paa.tracking/git/tracking/release_notes.md +5 -0
- llm_function/.paa.tracking/git_repo/COMMIT_EDITMSG +1 -0
- llm_function/.paa.tracking/git_repo/HEAD +1 -0
- llm_function/.paa.tracking/git_repo/config +8 -0
- llm_function/.paa.tracking/git_repo/description +1 -0
- llm_function/.paa.tracking/git_repo/hooks/applypatch-msg.sample +15 -0
- llm_function/.paa.tracking/git_repo/hooks/commit-msg.sample +24 -0
- llm_function/.paa.tracking/git_repo/hooks/fsmonitor-watchman.sample +174 -0
- llm_function/.paa.tracking/git_repo/hooks/post-update.sample +8 -0
- llm_function/.paa.tracking/git_repo/hooks/pre-applypatch.sample +14 -0
- llm_function/.paa.tracking/git_repo/hooks/pre-commit.sample +49 -0
- llm_function/.paa.tracking/git_repo/hooks/pre-merge-commit.sample +13 -0
- llm_function/.paa.tracking/git_repo/hooks/pre-push.sample +53 -0
- llm_function/.paa.tracking/git_repo/hooks/pre-rebase.sample +169 -0
- llm_function/.paa.tracking/git_repo/hooks/pre-receive.sample +24 -0
- llm_function/.paa.tracking/git_repo/hooks/prepare-commit-msg.sample +42 -0
- llm_function/.paa.tracking/git_repo/hooks/push-to-checkout.sample +78 -0
- llm_function/.paa.tracking/git_repo/hooks/sendemail-validate.sample +77 -0
- llm_function/.paa.tracking/git_repo/hooks/update.sample +128 -0
- llm_function/.paa.tracking/git_repo/index +0 -0
- llm_function/.paa.tracking/git_repo/info/exclude +6 -0
- llm_function/.paa.tracking/git_repo/logs/HEAD +1 -0
- llm_function/.paa.tracking/git_repo/logs/refs/heads/master +1 -0
- llm_function/.paa.tracking/git_repo/objects/13/9201e8ffeb4e42262e90eeaefd5267debb6e1d +1 -0
- llm_function/.paa.tracking/git_repo/objects/23/d10b479e3102724a6eb510225cc24bb2ce9d78 +0 -0
- llm_function/.paa.tracking/git_repo/objects/2d/fa3abff2848ff521ead3abb4364bd2c3ca01a6 +0 -0
- llm_function/.paa.tracking/git_repo/objects/45/6fc88abc846d76e0f82a3ef180425e497f8281 +0 -0
- llm_function/.paa.tracking/git_repo/objects/55/d196aad68e2cc20a2ea496529d9dabeb75bb0e +0 -0
- llm_function/.paa.tracking/git_repo/objects/63/9282ebc80b9db9b677374a7c16bc7472d5e71c +0 -0
- llm_function/.paa.tracking/git_repo/objects/91/f1d4c0830abe4ebb0902dc052f5dfe9e8fade7 +0 -0
- llm_function/.paa.tracking/git_repo/objects/9d/2a8151dd42e6abfffbbbd674b850a7066daa1a +0 -0
- llm_function/.paa.tracking/git_repo/objects/aa/0b3847c3f0683eed107a405b9443ec040c3eec +0 -0
- llm_function/.paa.tracking/git_repo/objects/cf/024b71ae427969a985d86a267adf154f526cd8 +0 -0
- llm_function/.paa.tracking/git_repo/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
- llm_function/.paa.tracking/git_repo/objects/fb/834f2f59b432c0688699b91926899c0e0f2a5d +0 -0
- llm_function/.paa.tracking/git_repo/refs/heads/master +1 -0
- llm_function/.paa.tracking/git_repo/refs/tags/v0.0.1 +1 -0
- llm_function/.paa.tracking/lsts_package_versions.yml +3 -0
- llm_function/.paa.tracking/package_licenses.json +1 -0
- llm_function/.paa.tracking/package_mapping.json +1 -0
- llm_function/.paa.tracking/python_modules/components/llm_func_deps/llm_function_config.py +35 -0
- llm_function/.paa.tracking/python_modules/components/llm_func_deps/tool_registry.py +250 -0
- llm_function/.paa.tracking/python_modules/llm_function.py +250 -0
- llm_function/.paa.tracking/release_notes.md +5 -0
- llm_function/.paa.tracking/version_logs.csv +5 -0
- llm_function/__init__.py +17 -0
- llm_function/artifacts/.paa.tracking/git/dependencies/llm_func_deps/llm_function_config.py +35 -0
- llm_function/artifacts/.paa.tracking/git/dependencies/llm_func_deps/tool_registry.py +250 -0
- llm_function/artifacts/.paa.tracking/git/docs_cache/llm_function.md +0 -0
- llm_function/artifacts/.paa.tracking/git/module/llm_function.py +250 -0
- llm_function/artifacts/.paa.tracking/git/tracking/release_notes.md +5 -0
- llm_function/artifacts/.paa.tracking/git_repo/COMMIT_EDITMSG +1 -0
- llm_function/artifacts/.paa.tracking/git_repo/HEAD +1 -0
- llm_function/artifacts/.paa.tracking/git_repo/config +8 -0
- llm_function/artifacts/.paa.tracking/git_repo/description +1 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/applypatch-msg.sample +15 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/commit-msg.sample +24 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/fsmonitor-watchman.sample +174 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/post-update.sample +8 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-applypatch.sample +14 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-commit.sample +49 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-merge-commit.sample +13 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-push.sample +53 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-rebase.sample +169 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/pre-receive.sample +24 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/prepare-commit-msg.sample +42 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/push-to-checkout.sample +78 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/sendemail-validate.sample +77 -0
- llm_function/artifacts/.paa.tracking/git_repo/hooks/update.sample +128 -0
- llm_function/artifacts/.paa.tracking/git_repo/index +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/info/exclude +6 -0
- llm_function/artifacts/.paa.tracking/git_repo/logs/HEAD +1 -0
- llm_function/artifacts/.paa.tracking/git_repo/logs/refs/heads/master +1 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/13/9201e8ffeb4e42262e90eeaefd5267debb6e1d +1 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/23/d10b479e3102724a6eb510225cc24bb2ce9d78 +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/2d/fa3abff2848ff521ead3abb4364bd2c3ca01a6 +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/45/6fc88abc846d76e0f82a3ef180425e497f8281 +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/55/d196aad68e2cc20a2ea496529d9dabeb75bb0e +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/63/9282ebc80b9db9b677374a7c16bc7472d5e71c +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/91/f1d4c0830abe4ebb0902dc052f5dfe9e8fade7 +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/9d/2a8151dd42e6abfffbbbd674b850a7066daa1a +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/aa/0b3847c3f0683eed107a405b9443ec040c3eec +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/cf/024b71ae427969a985d86a267adf154f526cd8 +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/objects/fb/834f2f59b432c0688699b91926899c0e0f2a5d +0 -0
- llm_function/artifacts/.paa.tracking/git_repo/refs/heads/master +1 -0
- llm_function/artifacts/.paa.tracking/git_repo/refs/tags/v0.0.1 +1 -0
- llm_function/llm_function.py +518 -0
- llm_function/mkdocs/docs/css/extra.css +38 -0
- llm_function/mkdocs/docs/index.md +24 -0
- llm_function/mkdocs/docs/llm_function_tools.md +168 -0
- llm_function/mkdocs/docs/release-notes.md +5 -0
- llm_function/mkdocs/mkdocs.yml +37 -0
- llm_function/mkdocs/site/404.html +370 -0
- llm_function/mkdocs/site/assets/images/favicon.png +0 -0
- llm_function/mkdocs/site/assets/javascripts/bundle.fe8b6f2b.min.js +29 -0
- llm_function/mkdocs/site/assets/javascripts/bundle.fe8b6f2b.min.js.map +7 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/tinyseg.js +206 -0
- llm_function/mkdocs/site/assets/javascripts/lunr/wordcut.js +6708 -0
- llm_function/mkdocs/site/assets/javascripts/workers/search.b8dbb3d2.min.js +42 -0
- llm_function/mkdocs/site/assets/javascripts/workers/search.b8dbb3d2.min.js.map +7 -0
- llm_function/mkdocs/site/assets/stylesheets/main.3cba04c6.min.css +1 -0
- llm_function/mkdocs/site/assets/stylesheets/main.3cba04c6.min.css.map +1 -0
- llm_function/mkdocs/site/assets/stylesheets/palette.06af60db.min.css +1 -0
- llm_function/mkdocs/site/assets/stylesheets/palette.06af60db.min.css.map +1 -0
- llm_function/mkdocs/site/css/extra.css +38 -0
- llm_function/mkdocs/site/index.html +476 -0
- llm_function/mkdocs/site/llm_function_tools/index.html +622 -0
- llm_function/mkdocs/site/release-notes/index.html +468 -0
- llm_function/mkdocs/site/search/search_index.json +1 -0
- llm_function/mkdocs/site/sitemap.xml +3 -0
- llm_function/mkdocs/site/sitemap.xml.gz +0 -0
- llm_function/setup.py +47 -0
- llm_function-0.0.1.dist-info/METADATA +44 -0
- llm_function-0.0.1.dist-info/RECORD +157 -0
- llm_function-0.0.1.dist-info/WHEEL +5 -0
- llm_function-0.0.1.dist-info/licenses/LICENSE +201 -0
- llm_function-0.0.1.dist-info/licenses/NOTICE +4 -0
- llm_function-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
# An example hook script to validate a patch (and/or patch series) before
|
|
4
|
+
# sending it via email.
|
|
5
|
+
#
|
|
6
|
+
# The hook should exit with non-zero status after issuing an appropriate
|
|
7
|
+
# message if it wants to prevent the email(s) from being sent.
|
|
8
|
+
#
|
|
9
|
+
# To enable this hook, rename this file to "sendemail-validate".
|
|
10
|
+
#
|
|
11
|
+
# By default, it will only check that the patch(es) can be applied on top of
|
|
12
|
+
# the default upstream branch without conflicts in a secondary worktree. After
|
|
13
|
+
# validation (successful or not) of the last patch of a series, the worktree
|
|
14
|
+
# will be deleted.
|
|
15
|
+
#
|
|
16
|
+
# The following config variables can be set to change the default remote and
|
|
17
|
+
# remote ref that are used to apply the patches against:
|
|
18
|
+
#
|
|
19
|
+
# sendemail.validateRemote (default: origin)
|
|
20
|
+
# sendemail.validateRemoteRef (default: HEAD)
|
|
21
|
+
#
|
|
22
|
+
# Replace the TODO placeholders with appropriate checks according to your
|
|
23
|
+
# needs.
|
|
24
|
+
|
|
25
|
+
validate_cover_letter () {
|
|
26
|
+
file="$1"
|
|
27
|
+
# TODO: Replace with appropriate checks (e.g. spell checking).
|
|
28
|
+
true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
validate_patch () {
|
|
32
|
+
file="$1"
|
|
33
|
+
# Ensure that the patch applies without conflicts.
|
|
34
|
+
git am -3 "$file" || return
|
|
35
|
+
# TODO: Replace with appropriate checks for this patch
|
|
36
|
+
# (e.g. checkpatch.pl).
|
|
37
|
+
true
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
validate_series () {
|
|
41
|
+
# TODO: Replace with appropriate checks for the whole series
|
|
42
|
+
# (e.g. quick build, coding style checks, etc.).
|
|
43
|
+
true
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# main -------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
if test "$GIT_SENDEMAIL_FILE_COUNTER" = 1
|
|
49
|
+
then
|
|
50
|
+
remote=$(git config --default origin --get sendemail.validateRemote) &&
|
|
51
|
+
ref=$(git config --default HEAD --get sendemail.validateRemoteRef) &&
|
|
52
|
+
worktree=$(mktemp --tmpdir -d sendemail-validate.XXXXXXX) &&
|
|
53
|
+
git worktree add -fd --checkout "$worktree" "refs/remotes/$remote/$ref" &&
|
|
54
|
+
git config --replace-all sendemail.validateWorktree "$worktree"
|
|
55
|
+
else
|
|
56
|
+
worktree=$(git config --get sendemail.validateWorktree)
|
|
57
|
+
fi || {
|
|
58
|
+
echo "sendemail-validate: error: failed to prepare worktree" >&2
|
|
59
|
+
exit 1
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
unset GIT_DIR GIT_WORK_TREE
|
|
63
|
+
cd "$worktree" &&
|
|
64
|
+
|
|
65
|
+
if grep -q "^diff --git " "$1"
|
|
66
|
+
then
|
|
67
|
+
validate_patch "$1"
|
|
68
|
+
else
|
|
69
|
+
validate_cover_letter "$1"
|
|
70
|
+
fi &&
|
|
71
|
+
|
|
72
|
+
if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL"
|
|
73
|
+
then
|
|
74
|
+
git config --unset-all sendemail.validateWorktree &&
|
|
75
|
+
trap 'git worktree remove -ff "$worktree"' EXIT &&
|
|
76
|
+
validate_series
|
|
77
|
+
fi
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# An example hook script to block unannotated tags from entering.
|
|
4
|
+
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
|
|
5
|
+
#
|
|
6
|
+
# To enable this hook, rename this file to "update".
|
|
7
|
+
#
|
|
8
|
+
# Config
|
|
9
|
+
# ------
|
|
10
|
+
# hooks.allowunannotated
|
|
11
|
+
# This boolean sets whether unannotated tags will be allowed into the
|
|
12
|
+
# repository. By default they won't be.
|
|
13
|
+
# hooks.allowdeletetag
|
|
14
|
+
# This boolean sets whether deleting tags will be allowed in the
|
|
15
|
+
# repository. By default they won't be.
|
|
16
|
+
# hooks.allowmodifytag
|
|
17
|
+
# This boolean sets whether a tag may be modified after creation. By default
|
|
18
|
+
# it won't be.
|
|
19
|
+
# hooks.allowdeletebranch
|
|
20
|
+
# This boolean sets whether deleting branches will be allowed in the
|
|
21
|
+
# repository. By default they won't be.
|
|
22
|
+
# hooks.denycreatebranch
|
|
23
|
+
# This boolean sets whether remotely creating branches will be denied
|
|
24
|
+
# in the repository. By default this is allowed.
|
|
25
|
+
#
|
|
26
|
+
|
|
27
|
+
# --- Command line
|
|
28
|
+
refname="$1"
|
|
29
|
+
oldrev="$2"
|
|
30
|
+
newrev="$3"
|
|
31
|
+
|
|
32
|
+
# --- Safety check
|
|
33
|
+
if [ -z "$GIT_DIR" ]; then
|
|
34
|
+
echo "Don't run this script from the command line." >&2
|
|
35
|
+
echo " (if you want, you could supply GIT_DIR then run" >&2
|
|
36
|
+
echo " $0 <ref> <oldrev> <newrev>)" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
|
|
41
|
+
echo "usage: $0 <ref> <oldrev> <newrev>" >&2
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# --- Config
|
|
46
|
+
allowunannotated=$(git config --type=bool hooks.allowunannotated)
|
|
47
|
+
allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch)
|
|
48
|
+
denycreatebranch=$(git config --type=bool hooks.denycreatebranch)
|
|
49
|
+
allowdeletetag=$(git config --type=bool hooks.allowdeletetag)
|
|
50
|
+
allowmodifytag=$(git config --type=bool hooks.allowmodifytag)
|
|
51
|
+
|
|
52
|
+
# check for no description
|
|
53
|
+
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
|
|
54
|
+
case "$projectdesc" in
|
|
55
|
+
"Unnamed repository"* | "")
|
|
56
|
+
echo "*** Project description file hasn't been set" >&2
|
|
57
|
+
exit 1
|
|
58
|
+
;;
|
|
59
|
+
esac
|
|
60
|
+
|
|
61
|
+
# --- Check types
|
|
62
|
+
# if $newrev is 0000...0000, it's a commit to delete a ref.
|
|
63
|
+
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
|
|
64
|
+
if [ "$newrev" = "$zero" ]; then
|
|
65
|
+
newrev_type=delete
|
|
66
|
+
else
|
|
67
|
+
newrev_type=$(git cat-file -t $newrev)
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
case "$refname","$newrev_type" in
|
|
71
|
+
refs/tags/*,commit)
|
|
72
|
+
# un-annotated tag
|
|
73
|
+
short_refname=${refname##refs/tags/}
|
|
74
|
+
if [ "$allowunannotated" != "true" ]; then
|
|
75
|
+
echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
|
|
76
|
+
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
|
|
77
|
+
exit 1
|
|
78
|
+
fi
|
|
79
|
+
;;
|
|
80
|
+
refs/tags/*,delete)
|
|
81
|
+
# delete tag
|
|
82
|
+
if [ "$allowdeletetag" != "true" ]; then
|
|
83
|
+
echo "*** Deleting a tag is not allowed in this repository" >&2
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
;;
|
|
87
|
+
refs/tags/*,tag)
|
|
88
|
+
# annotated tag
|
|
89
|
+
if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
|
|
90
|
+
then
|
|
91
|
+
echo "*** Tag '$refname' already exists." >&2
|
|
92
|
+
echo "*** Modifying a tag is not allowed in this repository." >&2
|
|
93
|
+
exit 1
|
|
94
|
+
fi
|
|
95
|
+
;;
|
|
96
|
+
refs/heads/*,commit)
|
|
97
|
+
# branch
|
|
98
|
+
if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
|
|
99
|
+
echo "*** Creating a branch is not allowed in this repository" >&2
|
|
100
|
+
exit 1
|
|
101
|
+
fi
|
|
102
|
+
;;
|
|
103
|
+
refs/heads/*,delete)
|
|
104
|
+
# delete branch
|
|
105
|
+
if [ "$allowdeletebranch" != "true" ]; then
|
|
106
|
+
echo "*** Deleting a branch is not allowed in this repository" >&2
|
|
107
|
+
exit 1
|
|
108
|
+
fi
|
|
109
|
+
;;
|
|
110
|
+
refs/remotes/*,commit)
|
|
111
|
+
# tracking branch
|
|
112
|
+
;;
|
|
113
|
+
refs/remotes/*,delete)
|
|
114
|
+
# delete tracking branch
|
|
115
|
+
if [ "$allowdeletebranch" != "true" ]; then
|
|
116
|
+
echo "*** Deleting a tracking branch is not allowed in this repository" >&2
|
|
117
|
+
exit 1
|
|
118
|
+
fi
|
|
119
|
+
;;
|
|
120
|
+
*)
|
|
121
|
+
# Anything else (is there anything else?)
|
|
122
|
+
echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
|
|
123
|
+
exit 1
|
|
124
|
+
;;
|
|
125
|
+
esac
|
|
126
|
+
|
|
127
|
+
# --- Finished
|
|
128
|
+
exit 0
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0000000000000000000000000000000000000000 139201e8ffeb4e42262e90eeaefd5267debb6e1d PAA Checkpoint <paa@local> 1774799656 +0000 commit (initial): checkpoint[make-package] version=0.0.1 ts=2026-03-29T15:54:16.335632+00:00
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0000000000000000000000000000000000000000 139201e8ffeb4e42262e90eeaefd5267debb6e1d PAA Checkpoint <paa@local> 1774799656 +0000 commit (initial): checkpoint[make-package] version=0.0.1 ts=2026-03-29T15:54:16.335632+00:00
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
x����@D����ȾD����3��"��X�~���SN2gN���&�n�LJ�:8����yXC�v%��1%4)o���_��3��G85�)�c�݄x�c�~�Ze�7�������+��,���;�'>�o��6�+X�!-�`��L��_�.�*�)��F�U�\
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
139201e8ffeb4e42262e90eeaefd5267debb6e1d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
139201e8ffeb4e42262e90eeaefd5267debb6e1d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Config models for llm_function runtime wiring.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Any, Optional, Sequence
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, Field
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class LlmRuntimeConfig(BaseModel):
|
|
11
|
+
"""
|
|
12
|
+
Reusable runtime settings for llm_function execution.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
llm_handler_params: dict = Field(description="Parameters passed to WorkflowAutoAssembler LLM handler.")
|
|
16
|
+
storage_path: Optional[str] = Field(default=None, description="Optional storage path for workflow persistence.")
|
|
17
|
+
force_replan: bool = Field(default=False, description="Force workflow replanning instead of reusing cached workflows.")
|
|
18
|
+
max_retry: Optional[int] = Field(default=None, description="Optional max retry override for planning loops.")
|
|
19
|
+
reset_loops: Optional[int] = Field(default=None, description="Optional reset loop override for planning loops.")
|
|
20
|
+
compare_params: Optional[dict] = Field(default=None, description="Optional compare parameters for workflow validation.")
|
|
21
|
+
test_params: Optional[list] = Field(default=None, description="Optional test cases for planning/validation.")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class LlmFunctionConfig(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Bundled llm_function configuration for future config-driven decorator usage.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
runtime: LlmRuntimeConfig = Field(description="Runtime settings for workflow execution.")
|
|
30
|
+
tool_sources: Optional[Sequence[Any]] = Field(default=None, description="Configured tool sources for runtime loading.")
|
|
31
|
+
tool_registry: Optional[Any] = Field(default=None, description="Optional prebuilt tool registry.")
|
|
32
|
+
|
|
33
|
+
model_config = {
|
|
34
|
+
"arbitrary_types_allowed": True,
|
|
35
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Runtime tool loading helpers for llm_function.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import attrs
|
|
6
|
+
import attrsx
|
|
7
|
+
import inspect
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Any, Callable, Dict, List, Optional, Sequence, Union
|
|
10
|
+
|
|
11
|
+
from pydantic import BaseModel, Field, SkipValidation
|
|
12
|
+
from workflow_auto_assembler import LlmFunctionItem, make_uid
|
|
13
|
+
|
|
14
|
+
from llm_function_tools import (
|
|
15
|
+
ToolSpec,
|
|
16
|
+
load_tools_from_module,
|
|
17
|
+
load_tools_from_python_file,
|
|
18
|
+
tool_from_callable,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ResolvedTool(BaseModel):
|
|
23
|
+
"""
|
|
24
|
+
Runtime-ready tool definition with provenance metadata.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
tool_spec: ToolSpec = Field(description="Normalized tool definition.")
|
|
28
|
+
func: SkipValidation[Callable[..., Any]] = Field(description="Runtime callable for the tool.")
|
|
29
|
+
source_type: str = Field(description="Source kind, for example file or module.")
|
|
30
|
+
location_type: str = Field(description="Location kind, for example local or external.")
|
|
31
|
+
package_name: Optional[str] = Field(default=None, description="Optional package name.")
|
|
32
|
+
package_version: Optional[str] = Field(default=None, description="Optional resolved package version.")
|
|
33
|
+
module_name: Optional[str] = Field(default=None, description="Python module that defined the tool.")
|
|
34
|
+
file_path: Optional[str] = Field(default=None, description="Local file path when the tool was loaded from a file.")
|
|
35
|
+
origin_ref: Optional[str] = Field(default=None, description="Original source reference used to load the tool.")
|
|
36
|
+
metadata: dict = Field(default_factory=dict, description="Additional runtime metadata.")
|
|
37
|
+
|
|
38
|
+
model_config = {
|
|
39
|
+
"arbitrary_types_allowed": True,
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@attrsx.define
|
|
44
|
+
class InMemoryToolSource:
|
|
45
|
+
"""
|
|
46
|
+
Resolve tools directly from callables, ToolSpec objects, or ResolvedTool objects.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
tools: Sequence[Union[Callable[..., Any], ToolSpec, ResolvedTool]] = attrs.field()
|
|
50
|
+
location_type: str = attrs.field(default="local")
|
|
51
|
+
package_name: Optional[str] = attrs.field(default=None)
|
|
52
|
+
package_version: Optional[str] = attrs.field(default=None)
|
|
53
|
+
origin_ref: Optional[str] = attrs.field(default=None)
|
|
54
|
+
|
|
55
|
+
def __attrs_post_init__(self):
|
|
56
|
+
self.tools = list(self.tools)
|
|
57
|
+
|
|
58
|
+
def load_tools(self) -> List[ResolvedTool]:
|
|
59
|
+
"""
|
|
60
|
+
Resolve in-memory tools into runtime tool records.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
resolved_tools: List[ResolvedTool] = []
|
|
64
|
+
for item in self.tools:
|
|
65
|
+
if isinstance(item, ResolvedTool):
|
|
66
|
+
resolved_tools.append(item)
|
|
67
|
+
continue
|
|
68
|
+
|
|
69
|
+
tool_spec = item if isinstance(item, ToolSpec) else tool_from_callable(item)
|
|
70
|
+
resolved_tools.append(
|
|
71
|
+
ResolvedTool(
|
|
72
|
+
tool_spec=tool_spec,
|
|
73
|
+
func=tool_spec.func,
|
|
74
|
+
source_type="memory",
|
|
75
|
+
location_type=self.location_type,
|
|
76
|
+
package_name=self.package_name,
|
|
77
|
+
package_version=self.package_version,
|
|
78
|
+
module_name=getattr(tool_spec.func, "__module__", None),
|
|
79
|
+
origin_ref=self.origin_ref,
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return resolved_tools
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@attrsx.define
|
|
87
|
+
class PythonModuleToolSource:
|
|
88
|
+
"""
|
|
89
|
+
Resolve tools from an importable Python module.
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
module_name: str = attrs.field()
|
|
93
|
+
include_plain_typed: bool = attrs.field(default=False)
|
|
94
|
+
location_type: str = attrs.field(default="local")
|
|
95
|
+
package_name: Optional[str] = attrs.field(default=None)
|
|
96
|
+
package_version: Optional[str] = attrs.field(default=None)
|
|
97
|
+
|
|
98
|
+
def load_tools(self) -> List[ResolvedTool]:
|
|
99
|
+
"""
|
|
100
|
+
Import module and resolve tools declared inside it.
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
resolved_tools: List[ResolvedTool] = []
|
|
104
|
+
for tool_spec in load_tools_from_module(
|
|
105
|
+
self.module_name,
|
|
106
|
+
include_plain_typed=self.include_plain_typed,
|
|
107
|
+
):
|
|
108
|
+
resolved_tools.append(
|
|
109
|
+
ResolvedTool(
|
|
110
|
+
tool_spec=tool_spec,
|
|
111
|
+
func=tool_spec.func,
|
|
112
|
+
source_type="module",
|
|
113
|
+
location_type=self.location_type,
|
|
114
|
+
package_name=self.package_name,
|
|
115
|
+
package_version=self.package_version,
|
|
116
|
+
module_name=self.module_name,
|
|
117
|
+
origin_ref=self.module_name,
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
return resolved_tools
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@attrsx.define
|
|
125
|
+
class PythonFileToolSource:
|
|
126
|
+
"""
|
|
127
|
+
Resolve tools from a standalone Python file path.
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
file_path: str = attrs.field()
|
|
131
|
+
include_plain_typed: bool = attrs.field(default=False)
|
|
132
|
+
location_type: str = attrs.field(default="local")
|
|
133
|
+
package_name: Optional[str] = attrs.field(default=None)
|
|
134
|
+
package_version: Optional[str] = attrs.field(default=None)
|
|
135
|
+
module_name: Optional[str] = attrs.field(default=None)
|
|
136
|
+
|
|
137
|
+
def load_tools(self) -> List[ResolvedTool]:
|
|
138
|
+
"""
|
|
139
|
+
Import file and resolve tools declared inside it.
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
resolved_path = str(Path(self.file_path).expanduser().resolve())
|
|
143
|
+
resolved_tools: List[ResolvedTool] = []
|
|
144
|
+
for tool_spec in load_tools_from_python_file(
|
|
145
|
+
resolved_path,
|
|
146
|
+
include_plain_typed=self.include_plain_typed,
|
|
147
|
+
module_name=self.module_name,
|
|
148
|
+
):
|
|
149
|
+
resolved_tools.append(
|
|
150
|
+
ResolvedTool(
|
|
151
|
+
tool_spec=tool_spec,
|
|
152
|
+
func=tool_spec.func,
|
|
153
|
+
source_type="file",
|
|
154
|
+
location_type=self.location_type,
|
|
155
|
+
package_name=self.package_name,
|
|
156
|
+
package_version=self.package_version,
|
|
157
|
+
module_name=getattr(tool_spec.func, "__module__", self.module_name),
|
|
158
|
+
file_path=resolved_path,
|
|
159
|
+
origin_ref=resolved_path,
|
|
160
|
+
)
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
return resolved_tools
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
@attrsx.define
|
|
167
|
+
class ToolRegistry:
|
|
168
|
+
"""
|
|
169
|
+
Aggregate tools from one or more sources and expose WAA-compatible tool lists.
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
sources: Sequence[object] = attrs.field()
|
|
173
|
+
_resolved_tools: Optional[List[ResolvedTool]] = attrs.field(default=None)
|
|
174
|
+
|
|
175
|
+
def __attrs_post_init__(self):
|
|
176
|
+
self.sources = list(self.sources)
|
|
177
|
+
|
|
178
|
+
def load_tools(self, reload: bool = False) -> List[ResolvedTool]:
|
|
179
|
+
"""
|
|
180
|
+
Resolve all configured sources into runtime tools.
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
if self._resolved_tools is not None and not reload:
|
|
184
|
+
return list(self._resolved_tools)
|
|
185
|
+
|
|
186
|
+
resolved_tools: List[ResolvedTool] = []
|
|
187
|
+
seen_keys = set()
|
|
188
|
+
|
|
189
|
+
for source in self.sources:
|
|
190
|
+
for resolved_tool in source.load_tools():
|
|
191
|
+
dedupe_key = (
|
|
192
|
+
resolved_tool.tool_spec.name,
|
|
193
|
+
resolved_tool.module_name,
|
|
194
|
+
resolved_tool.file_path,
|
|
195
|
+
resolved_tool.package_name,
|
|
196
|
+
resolved_tool.package_version,
|
|
197
|
+
)
|
|
198
|
+
if dedupe_key in seen_keys:
|
|
199
|
+
continue
|
|
200
|
+
seen_keys.add(dedupe_key)
|
|
201
|
+
resolved_tools.append(resolved_tool)
|
|
202
|
+
|
|
203
|
+
self._resolved_tools = resolved_tools
|
|
204
|
+
return list(self._resolved_tools)
|
|
205
|
+
|
|
206
|
+
@staticmethod
|
|
207
|
+
def _safe_source_code(func: Callable[..., Any]) -> str:
|
|
208
|
+
"""
|
|
209
|
+
Best-effort source capture for stable tool hashing.
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
try:
|
|
213
|
+
return inspect.getsource(func)
|
|
214
|
+
except (OSError, TypeError):
|
|
215
|
+
return getattr(func, "__qualname__", getattr(func, "__name__", ""))
|
|
216
|
+
|
|
217
|
+
def build_available_tools(self) -> Dict[str, Any]:
|
|
218
|
+
"""
|
|
219
|
+
Convert resolved tools into WorkflowAutoAssembler-compatible structures.
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
available_functions: List[LlmFunctionItem] = []
|
|
223
|
+
available_callables: Dict[str, Callable[..., Any]] = {}
|
|
224
|
+
|
|
225
|
+
for resolved_tool in self.load_tools():
|
|
226
|
+
llm_func_item = {
|
|
227
|
+
"name": resolved_tool.tool_spec.name,
|
|
228
|
+
"description": resolved_tool.tool_spec.description,
|
|
229
|
+
"input_schema_json": resolved_tool.tool_spec.input_model.model_json_schema(),
|
|
230
|
+
"output_schema_json": resolved_tool.tool_spec.output_model.model_json_schema(),
|
|
231
|
+
"code": self._safe_source_code(resolved_tool.func),
|
|
232
|
+
}
|
|
233
|
+
func_id = make_uid(d=llm_func_item)
|
|
234
|
+
|
|
235
|
+
available_functions.append(
|
|
236
|
+
LlmFunctionItem(
|
|
237
|
+
func_id=func_id,
|
|
238
|
+
name=llm_func_item["name"],
|
|
239
|
+
description=llm_func_item["description"],
|
|
240
|
+
input_schema_json=llm_func_item["input_schema_json"],
|
|
241
|
+
output_schema_json=llm_func_item["output_schema_json"],
|
|
242
|
+
)
|
|
243
|
+
)
|
|
244
|
+
available_callables[func_id] = resolved_tool.func
|
|
245
|
+
|
|
246
|
+
return {
|
|
247
|
+
"available_functions": available_functions,
|
|
248
|
+
"available_callables": available_callables,
|
|
249
|
+
"resolved_tools": self.load_tools(),
|
|
250
|
+
}
|