Skip to content

Latest commit

 

History

History
187 lines (169 loc) · 10.2 KB

File metadata and controls

187 lines (169 loc) · 10.2 KB

�[2m�[35m[tokens] prompt 1,098 (1,024 cached, 93%) | completion 365 | total 1,463�[0m �[36m�[1m▶ create_tool(name='file_stats', description='Get stats about Python files in a directory: count, total lines, and list files.', parameters='{"type":"object","properties":{"dir_path":{"type":"string","description":…)�[0m �[2m OK: created tool 'file_stats' (Python function 't_file_stats'). Description: Get stats about Python files in a directory: count, total lines, and list files. It is now available — call it in your next turn.�[0m �[2m�[35m[tokens] prompt 1,596 (896 cached, 56%) | completion 62 | total 1,658�[0m �[36m�[1m▶ file_stats(dir_path='agentknit')�[0m �[2m Found 0 Python files, 0 total lines.�[0m �[2m�[35m[tokens] prompt 1,680 (1,536 cached, 91%) | completion 74 | total 1,754�[0m �[36m�[1m▶ file_stats(dir_path='.')�[0m �[2m Found 13 Python files, 4978 total lines.�[0m �[2m�[35m[tokens] prompt 1,777 (1,664 cached, 94%) | completion 331 | total 2,108�[0m �[36m�[1m▶ create_tool(description='List files and subdirectories in a given directory. Returns a list of entries with name, type, and size.', name='list_dir', parameters='{"type":"object","properties":{"dir_path":{"type":"…)�[0m �[2m OK: created tool 'list_dir' (Python function 't_list_dir'). Description: List files and subdirectories in a given directory. Returns a list of entries with name, type, and size. It is now available — call it in your next turn.�[0m �[2m�[35m[tokens] prompt 2,253 (896 cached, 40%) | completion 52 | total 2,305�[0m �[36m�[1m▶ list_dir(dir_path='.')�[0m �[2m Found 33 entries in /home/martin/workspace/prototypes/coding-agent-keynote.�[0m �[2m�[35m[tokens] prompt 2,338 (2,304 cached, 99%) | completion 331 | total 2,669�[0m �[36m�[1m▶ file_stats(dir_path='.')�[0m �[2m Found 13 Python files, 4978 total lines.�[0m �[2m�[35m[tokens] prompt 2,692 (2,560 cached, 95%) | completion 350 | total 3,042�[0m �[36m�[1m▶ create_tool(description='List Python files in a directory with line counts, including the list in the string output.', name='py_files_details', parameters='{"type":"object","properties":{"dir_path":{"type":"strin…)�[0m �[2m OK: created tool 'py_files_details' (Python function 't_py_files_details'). Description: List Python files in a directory with line counts, including the list in the string output. It is now available — call it in your next turn.�[0m �[2m�[35m[tokens] prompt 3,179 (1,024 cached, 32%) | completion 50 | total 3,229�[0m �[36m�[1m▶ py_files_details(dir_path='.')�[0m �[2m Python files (13 total, 4978 lines): ab_agent.py: 284 anthropic_sandbox_agent.py: 431 async_agent.py: 280 claude_sandbox_agent.py: 568 generate_all_traces.py: 451 keynote.py: 422 rc_agent.py: 237 secondguess_agent.py: 391 seed_agent.py: 318 self-reflect_agent.py: 756 slash_agent.py: 229 task_difficulty_agent.py: 250 tui_viewer.py: 361�[0m �[2m�[35m[tokens] prompt 3,383 (3,200 cached, 95%) | completion 392 | total 3,775�[0m �[36m�[1m▶ create_tool(description='Find the location of a Python package by trying to import it.', name='find_package', parameters='{"type":"object","properties":{"package_name":{"type":"string","description":"Package name…)�[0m �[2m OK: created tool 'find_package' (Python function 't_find_package'). Description: Find the location of a Python package by trying to import it. It is now available — call it in your next turn.�[0m �[2m�[35m[tokens] prompt 3,898 (1,024 cached, 26%) | completion 57 | total 3,955�[0m �[36m�[1m▶ find_package(package_name='agentknit')�[0m �[2m Package 'agentknit' found at /home/martin/workspace/prototypes/agentknit/agentknit/init.py�[0m �[2m�[35m[tokens] prompt 3,999 (3,840 cached, 96%) | completion 132 | total 4,131�[0m �[36m�[1m▶ py_files_details(dir_path='/home/martin/workspace/prototypes/agentknit/agentknit')�[0m �[2m Python files (8 total, 3837 lines): init.py: 102 _core.py: 1850 exceptions.py: 37 keys.py: 138 openai_compat.py: 413 slash_commands.py: 352 tool.py: 227 tool_library.py: 718�[0m �[2m�[35m[tokens] prompt 4,220 (4,096 cached, 97%) | completion 296 | total 4,516�[0m �[36m�[1m▶ create_tool(description='Read the content of a file and return it as a string.', name='read_file', parameters='{"type":"object","properties":{"file_path":{"type":"string","description":"Path to file"}},"required"…)�[0m �[2m OK: created tool 'read_file' (Python function 't_read_file'). Description: Read the content of a file and return it as a string. It is now available — call it in your next turn.�[0m �[2m�[35m[tokens] prompt 4,634 (1,152 cached, 25%) | completion 76 | total 4,710�[0m �[36m�[1m▶ read_file(file_path='/home/martin/workspace/prototypes/agentknit/agentknit/init.py')�[0m �[2m """agentknit — spec-driven coding agent framework for any OpenAI-compatible endpoint."""

version = "0.1.0"

from .exceptions import ( AgentProbeError, AgentSpecDisabledError, AgentSpecInvalidError, PricingLimitExceededError, AuthenticationError, )

from ._core import ( main, validate_schema, create_client, run_task, run_repl, SessionResult, CancelToken,�[0m �[2m … (82 more lines)�[0m �[2m�[35m[tokens] prompt 5,484 (4,608 cached, 84%) | completion 1,278 | total 6,762�[0m �[36m�[1m▶ create_tool(description='Get all public functions (no underscore prefix) exported by a package, determined by inspecting init.py imports and checking types.', name='get_public_functions', parameters='{"type":…)�[0m �[2m OK: created tool 'get_public_functions' (Python function 't_get_public_functions'). Description: Get all public functions (no underscore prefix) exported by a package, determined by inspecting init.py imports and checking types. It is now available — call it in your next turn.�[0m �[2m�[35m[tokens] prompt 6,916 (1,280 cached, 19%) | completion 59 | total 6,975�[0m �[36m�[1m▶ get_public_functions(package_name='agentknit')�[0m �[2m Public functions (26): EventCallback, build_tool_spec, check_and_display_pricing, create_client, dispatch, extract_inline_calls, fmt_call, fmt_result, fmt_usage, init_session, inline_system_prompt, load_or_probe, main, on, register_tools_in_library, run_repl, run_task, run_turn, safe_model_name, schema_props, subscribe, t_execute_async, t_query_exec, t_slash_command, unsubscribe, validate_schema�[0m �[2m�[35m[tokens] prompt 7,095 (6,912 cached, 97%) | completion 155 | total 7,250�[0m �[36m�[1m▶ read_file(file_path='/home/martin/workspace/prototypes/agentknit/agentknit/_core.py')�[0m �[2m #!/usr/bin/env python3 """ Generic CLI coding agent for any Completions API endpoint.

Run with --help for usage information.

Aliases ─────── The probe JSON may contain an optional top-level aliases table:

"aliases": {
  "execute": "execute_command",
  "run":     "execute_command"
}

Each entry maps an alias name to an existing tool name in tool_dispatch. At session start both the tool schema (for structured mode) and the dispatch table are expanded so the alias behaves identically to the canonical tool. An alias that already has its own tool_dispatch entry is left untouched. �[0m �[2m … (1830 more lines)�[0m �[2m�[35m[tokens] prompt 25,290 (7,168 cached, 28%) | completion 815 | total 26,105�[0m �[36m�[1m▶ create_tool(description="List all public functions (no underscore prefix) exported by a package, using all and inspecting each object's type.", name='get_public_functions_v2', parameters='{"type":"object","pr…)�[0m �[2m OK: created tool 'get_public_functions_v2' (Python function 't_get_public_functions_v2'). Description: List all public functions (no underscore prefix) exported by a package, using all and inspecting each object's type. It is now available — call it in your next turn.�[0m �[2m�[35m[tokens] prompt 26,261 (1,280 cached, 5%) | completion 57 | total 26,318�[0m �[36m�[1m▶ get_public_functions_v2(package_name='agentknit')�[0m �[2m Functions (25): build_tool_spec, check_and_display_pricing, create_client, dispatch, extract_inline_calls, fmt_call, fmt_result, fmt_usage, init_session, inline_system_prompt, load_or_probe, main, on, register_tools_in_library, run_repl, run_task, run_turn, safe_model_name, schema_props, subscribe, t_execute_async, t_query_exec, t_slash_command, unsubscribe, validate_schema Classes (11): AgentProbeError, AgentSpecDisabledError, AgentSpecInvalidError, AuthenticationError, CancelToken, FatalToolDispatchError, PricingLimitExceededError, SessionResult, SlashCommand, SlashCommandRegistry, Tool Constants (4): ASYNC_FAST_THRESHOLD_S, ASYNC_INLINE_MAX_BYTES, DEFAULT_ENDPOINT, DEFAULT_MAX_TOKENS Other (7): ASYNC_EXEC_DIR (PosixPath), EventCallback (_CallableGenericAlias), LOG_BASE (PosixPath), SLASH_COMMAND_TOOL (Tool), async_completion_queue (Queue), slash_registry (SlashCommandRegistry), slash_tool_ctx (dict)�[0m �[2m�[35m[tokens] prompt 26,589 (26,240 cached, 99%) | completion 651 | total 27,240�[0m

�[32m�[1m» �[0m## Results

1. How many Python files are in the agentknit package directory?

8 Python files:

  • __init__.py
  • _core.py
  • exceptions.py
  • keys.py
  • openai_compat.py
  • slash_commands.py
  • tool.py
  • tool_library.py

2. What is the total line count of all .py files combined?

3,837 lines.

3. Names of all public functions (no underscore prefix) exported by the agentknit package

25 public functions:

# Name
1 build_tool_spec
2 check_and_display_pricing
3 create_client
4 dispatch
5 extract_inline_calls
6 fmt_call
7 fmt_result
8 fmt_usage
9 init_session
10 inline_system_prompt
11 load_or_probe
12 main
13 on
14 register_tools_in_library
15 run_repl
16 run_task
17 run_turn
18 safe_model_name
19 schema_props
20 subscribe
21 t_execute_async
22 t_query_exec
23 t_slash_command
24 unsubscribe
25 validate_schema

�[2m�[35m[session tokens] prompt 134,382, 72,704 cached | completion 5,583 | total 139,965�[0m