ThinkPlatform-client 0.6.103__cp313-cp313-win_amd64.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.
Files changed (77) hide show
  1. thinkplatform/__init__.py +7 -0
  2. thinkplatform/_binary_init.cp313-win_amd64.pyd +0 -0
  3. thinkplatform/cli/__init__.py +7 -0
  4. thinkplatform/cli/__main__.py +5 -0
  5. thinkplatform/cli/_binary_agent_cost_snapshot.cp313-win_amd64.pyd +0 -0
  6. thinkplatform/cli/_binary_init.cp313-win_amd64.pyd +0 -0
  7. thinkplatform/cli/_binary_lakehouse_cost_snapshot.cp313-win_amd64.pyd +0 -0
  8. thinkplatform/cli/agent_cost_snapshot.py +23 -0
  9. thinkplatform/cli/auth.cp313-win_amd64.pyd +0 -0
  10. thinkplatform/cli/client.cp313-win_amd64.pyd +0 -0
  11. thinkplatform/cli/commands.cp313-win_amd64.pyd +0 -0
  12. thinkplatform/cli/config.cp313-win_amd64.pyd +0 -0
  13. thinkplatform/cli/lakehouse_cost_snapshot.py +23 -0
  14. thinkplatform/cli/main.cp313-win_amd64.pyd +0 -0
  15. thinkplatform/cli/openapi.cp313-win_amd64.pyd +0 -0
  16. thinkplatform/cli/persistent_auth.cp313-win_amd64.pyd +0 -0
  17. thinkplatform/cli/plugins.cp313-win_amd64.pyd +0 -0
  18. thinkplatform/cli/public_defaults.cp313-win_amd64.pyd +0 -0
  19. thinkplatform/sdk/__init__.py +7 -0
  20. thinkplatform/sdk/_binary_execution.cp313-win_amd64.pyd +0 -0
  21. thinkplatform/sdk/_binary_init.cp313-win_amd64.pyd +0 -0
  22. thinkplatform/sdk/client.cp313-win_amd64.pyd +0 -0
  23. thinkplatform/sdk/codeflow.cp313-win_amd64.pyd +0 -0
  24. thinkplatform/sdk/credentials.cp313-win_amd64.pyd +0 -0
  25. thinkplatform/sdk/errors.cp313-win_amd64.pyd +0 -0
  26. thinkplatform/sdk/execution.py +23 -0
  27. thinkplatform/sdk/models.cp313-win_amd64.pyd +0 -0
  28. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/plugins/thinkplatform/.codex-plugin/plugin.json +25 -0
  29. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-cost-analysis/SKILL.md +70 -0
  30. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-cost-analysis/agents/openai.yaml +4 -0
  31. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-cost-analysis/assets/agent-cost-analysis-report.md +105 -0
  32. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-cost-analysis/references/commands.md +130 -0
  33. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-cost-analysis/references/cost-model.md +87 -0
  34. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-cost-analysis/references/diagnostic-playbook.md +134 -0
  35. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-ops/SKILL.md +42 -0
  36. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-ops/agents/openai.yaml +4 -0
  37. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-agent-ops/references/commands.md +93 -0
  38. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-automation-ops/SKILL.md +49 -0
  39. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-automation-ops/agents/openai.yaml +4 -0
  40. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-automation-ops/references/commands.md +83 -0
  41. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-autonomous-plant-ops/SKILL.md +48 -0
  42. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-autonomous-plant-ops/agents/openai.yaml +4 -0
  43. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-autonomous-plant-ops/references/commands.md +66 -0
  44. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-business-workflows/SKILL.md +42 -0
  45. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-business-workflows/agents/openai.yaml +4 -0
  46. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-business-workflows/references/commands.md +67 -0
  47. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-canvas-interface/SKILL.md +58 -0
  48. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-canvas-interface/agents/openai.yaml +4 -0
  49. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-canvas-interface/references/commands.md +331 -0
  50. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-data-engineering/SKILL.md +53 -0
  51. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-data-engineering/agents/openai.yaml +4 -0
  52. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-data-engineering/references/commands.md +156 -0
  53. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-edge-ops/SKILL.md +43 -0
  54. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-edge-ops/agents/openai.yaml +4 -0
  55. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-edge-ops/references/commands.md +70 -0
  56. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-integrations-and-flows/SKILL.md +42 -0
  57. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-integrations-and-flows/agents/openai.yaml +4 -0
  58. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-integrations-and-flows/references/commands.md +82 -0
  59. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-ai/SKILL.md +43 -0
  60. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-ai/agents/openai.yaml +4 -0
  61. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-ai/references/commands.md +98 -0
  62. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-ai/references/patterns.md +203 -0
  63. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-cost-analysis/SKILL.md +62 -0
  64. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-cost-analysis/agents/openai.yaml +4 -0
  65. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-cost-analysis/assets/lakehouse-cost-analysis-report.md +65 -0
  66. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-cost-analysis/references/commands.md +63 -0
  67. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-cost-analysis/references/cost-model.md +50 -0
  68. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-lakehouse-cost-analysis/references/diagnostic-playbook.md +47 -0
  69. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-mlops/SKILL.md +69 -0
  70. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-mlops/agents/openai.yaml +4 -0
  71. thinkplatform_client-0.6.103.data/data/thinkplatform/bundled/skills/thinkplatform-mlops/references/commands.md +169 -0
  72. thinkplatform_client-0.6.103.dist-info/METADATA +109 -0
  73. thinkplatform_client-0.6.103.dist-info/RECORD +77 -0
  74. thinkplatform_client-0.6.103.dist-info/WHEEL +5 -0
  75. thinkplatform_client-0.6.103.dist-info/entry_points.txt +4 -0
  76. thinkplatform_client-0.6.103.dist-info/licenses/LICENSE +21 -0
  77. thinkplatform_client-0.6.103.dist-info/top_level.txt +1 -0
@@ -0,0 +1,7 @@
1
+ # Generated binary-wheel package bootstrap; no implementation source is shipped.
2
+ from . import _binary_init as _binary_init
3
+ from ._binary_init import *
4
+
5
+ __doc__ = _binary_init.__doc__
6
+ if hasattr(_binary_init, "__all__"):
7
+ __all__ = _binary_init.__all__
@@ -0,0 +1,7 @@
1
+ # Generated binary-wheel package bootstrap; no implementation source is shipped.
2
+ from . import _binary_init as _binary_init
3
+ from ._binary_init import *
4
+
5
+ __doc__ = _binary_init.__doc__
6
+ if hasattr(_binary_init, "__all__"):
7
+ __all__ = _binary_init.__all__
@@ -0,0 +1,5 @@
1
+ # Generated binary-wheel module runner; no implementation source is shipped.
2
+ from .main import main
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())
@@ -0,0 +1,23 @@
1
+ # Generated binary-wheel module runner; no implementation source is shipped.
2
+ from . import _binary_agent_cost_snapshot as _binary_agent_cost_snapshot
3
+ from ._binary_agent_cost_snapshot import *
4
+
5
+ for _name, _value in vars(_binary_agent_cost_snapshot).items():
6
+ if _name not in {"__name__", "__loader__", "__package__", "__spec__", "__file__", "__cached__", "__builtins__"}:
7
+ globals()[_name] = _value
8
+
9
+ __doc__ = _binary_agent_cost_snapshot.__doc__
10
+ if hasattr(_binary_agent_cost_snapshot, "__all__"):
11
+ __all__ = _binary_agent_cost_snapshot.__all__
12
+ else:
13
+ globals().pop("__all__", None)
14
+
15
+ for _value in vars(_binary_agent_cost_snapshot).values():
16
+ if getattr(_value, "__module__", None) == _binary_agent_cost_snapshot.__name__:
17
+ try:
18
+ _value.__module__ = __name__
19
+ except (AttributeError, TypeError):
20
+ pass
21
+
22
+ if __name__ == "__main__":
23
+ raise SystemExit(_binary_agent_cost_snapshot.main())
@@ -0,0 +1,23 @@
1
+ # Generated binary-wheel module runner; no implementation source is shipped.
2
+ from . import _binary_lakehouse_cost_snapshot as _binary_lakehouse_cost_snapshot
3
+ from ._binary_lakehouse_cost_snapshot import *
4
+
5
+ for _name, _value in vars(_binary_lakehouse_cost_snapshot).items():
6
+ if _name not in {"__name__", "__loader__", "__package__", "__spec__", "__file__", "__cached__", "__builtins__"}:
7
+ globals()[_name] = _value
8
+
9
+ __doc__ = _binary_lakehouse_cost_snapshot.__doc__
10
+ if hasattr(_binary_lakehouse_cost_snapshot, "__all__"):
11
+ __all__ = _binary_lakehouse_cost_snapshot.__all__
12
+ else:
13
+ globals().pop("__all__", None)
14
+
15
+ for _value in vars(_binary_lakehouse_cost_snapshot).values():
16
+ if getattr(_value, "__module__", None) == _binary_lakehouse_cost_snapshot.__name__:
17
+ try:
18
+ _value.__module__ = __name__
19
+ except (AttributeError, TypeError):
20
+ pass
21
+
22
+ if __name__ == "__main__":
23
+ raise SystemExit(_binary_lakehouse_cost_snapshot.main())
@@ -0,0 +1,7 @@
1
+ # Generated binary-wheel package bootstrap; no implementation source is shipped.
2
+ from . import _binary_init as _binary_init
3
+ from ._binary_init import *
4
+
5
+ __doc__ = _binary_init.__doc__
6
+ if hasattr(_binary_init, "__all__"):
7
+ __all__ = _binary_init.__all__
@@ -0,0 +1,23 @@
1
+ # Generated binary-wheel module runner; no implementation source is shipped.
2
+ from . import _binary_execution as _binary_execution
3
+ from ._binary_execution import *
4
+
5
+ for _name, _value in vars(_binary_execution).items():
6
+ if _name not in {"__name__", "__loader__", "__package__", "__spec__", "__file__", "__cached__", "__builtins__"}:
7
+ globals()[_name] = _value
8
+
9
+ __doc__ = _binary_execution.__doc__
10
+ if hasattr(_binary_execution, "__all__"):
11
+ __all__ = _binary_execution.__all__
12
+ else:
13
+ globals().pop("__all__", None)
14
+
15
+ for _value in vars(_binary_execution).values():
16
+ if getattr(_value, "__module__", None) == _binary_execution.__name__:
17
+ try:
18
+ _value.__module__ = __name__
19
+ except (AttributeError, TypeError):
20
+ pass
21
+
22
+ if __name__ == "__main__":
23
+ raise SystemExit(_binary_execution.main())
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "thinkplatform",
3
+ "version": "0.1.0",
4
+ "description": "ThinkPlatform agent plugin with bundled skills for the tp CLI, MLOps, home pages, business apps, and remote tool workflows.",
5
+ "author": {
6
+ "name": "ThinkPlatform"
7
+ },
8
+ "skills": "./skills/",
9
+ "interface": {
10
+ "displayName": "ThinkPlatform",
11
+ "shortDescription": "Operate ThinkPlatform with bundled agent skills.",
12
+ "longDescription": "Bundled agent guidance for using the tp CLI safely from Codex, Claude-compatible skill folders, or managed ThinkPlatform workspaces.",
13
+ "developerName": "ThinkPlatform",
14
+ "category": "Productivity",
15
+ "capabilities": [
16
+ "CLI",
17
+ "Agent guidance"
18
+ ],
19
+ "defaultPrompt": [
20
+ "Use tp to inspect my ThinkPlatform context.",
21
+ "Use tp plugins recommend for an MLOps workflow.",
22
+ "Install the ThinkPlatform plugin for Codex."
23
+ ]
24
+ }
25
+ }
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: thinkplatform-agent-cost-analysis
3
+ description: Use when investigating, explaining, auditing, or reporting unusually high ThinkPlatform Agent or LLM cost with the tp CLI. Trigger for requests about expensive projects, model spend, scheduled Agent runs, token or cache efficiency, prompt/context bloat, repeated Blob/PDF/OCR/tool work, runaway tasks, retries, budget risk, or cost comparisons across projects, Agents, tasks, users, models, and time windows.
4
+ ---
5
+
6
+ # ThinkPlatform Agent Cost Analysis
7
+
8
+ Diagnose Agent/LLM cost from provider actuals down to the ThinkPlatform configuration and execution behavior that produced it. Produce an evidence-backed Markdown report; keep the platform read-only unless the user separately authorizes changes.
9
+
10
+ ## Required Workflow
11
+
12
+ 1. Confirm the intended profile, org, project, analysis period, and report path. Read [commands](references/commands.md) before invoking `tp`.
13
+ 2. Collect a baseline snapshot with `tp-agent-cost-snapshot`. Use at least one complete billing window when available and keep dates explicit.
14
+ 3. Establish data quality before interpreting drivers:
15
+ - Treat provider actual cost as the financial source of truth.
16
+ - Report allocated, measured, and unallocated cost separately.
17
+ - State missing dimensions, stale provider data, and currency limitations.
18
+ - Read `collection_warnings` and `derived.dimension_coverage`; never infer historical model usage from current Agent settings when runtime model coverage is low.
19
+ 4. Rank cost by project, model, Agent, task, and user. Quantify concentration, daily changes, request counts, input/output/cached/reasoning tokens, and schedule run volume.
20
+ 5. Deep-dive only the highest-cost or anomalous tasks and schedules. Prefer `--summary`; retrieve raw messages only when summary evidence is insufficient and avoid reproducing sensitive content.
21
+ 6. Test each plausible mechanism using [diagnostic playbook](references/diagnostic-playbook.md). Distinguish:
22
+ - model price from token volume;
23
+ - required schedule volume from accidental fan-out, retry, or overlap;
24
+ - static prompt/context size from dynamic conversation growth;
25
+ - reusable cached prefixes from repeatedly changing prefixes;
26
+ - useful tool work from repeated file reads, conversion, OCR, search, or loop behavior.
27
+ 7. Check current provider pricing and billing semantics using [cost model](references/cost-model.md). Never rely on memorized or hard-coded model prices.
28
+ 8. Write the result from [report template](assets/agent-cost-analysis-report.md). Lead with quantified critical factors and confidence, then list supporting evidence, limitations, and prioritized recommendations.
29
+
30
+ ## Collection
31
+
32
+ Run from this skill directory or pass the script's absolute path:
33
+
34
+ ```bash
35
+ tp-agent-cost-snapshot \
36
+ --profile PROFILE \
37
+ --from YYYY-MM-DD \
38
+ --to YYYY-MM-DD \
39
+ --output /absolute/path/cost-snapshot.json
40
+ ```
41
+
42
+ The collector is read-only. It gathers cost allocation, budgets, Agents, tasks, schedules, Hooks, skills, compact schedule logs, and compact messages for the highest-cost tasks. It infers stopped schedules and task IDs from costly `agent-cycle-*` threads, records fallback/truncation/staleness as warnings, redacts raw prompts and identity fields by default, and falls back to `tp raw get` for older CLI installations. Use `--include-raw` or `--include-dimension-series` only for a targeted follow-up.
43
+
44
+ Run another snapshot for a comparison window when a model/configuration change or cost spike occurred. Compare equal-length periods where possible; do not compare raw totals across unequal durations without normalizing per day or per execution.
45
+
46
+ ## Analysis Rules
47
+
48
+ - Attribute cost to the smallest reliable dimension, but reconcile every slice to the same provider total.
49
+ - Use both cost share and activity share. A model can be expensive because of rate, volume, or both.
50
+ - Calculate schedule cost as successful and attempted executions multiplied by task cost; show the unavoidable baseline separately from avoidable retry, duplication, or overlap.
51
+ - Use cached-token data only with the provider's documented semantics. A low cache ratio is actionable only when requests share an eligible, byte-stable prefix.
52
+ - Treat long prompts, skills, and file context as hypotheses until task evidence shows repeated input or tool work.
53
+ - Do not label required business activity as waste. Quantify the marginal cost and identify cheaper ways to preserve the requirement.
54
+ - Do not recommend a model downgrade without considering accuracy, latency, tool support, context limits, and retry risk.
55
+ - Keep all recommendations read-only in the report unless the user explicitly requests implementation.
56
+
57
+ ## Deliverables
58
+
59
+ Create:
60
+
61
+ - the JSON snapshot used for analysis;
62
+ - a Markdown report with scope, executive summary, cost reconciliation, ranked drivers, hypothesis results, critical factors, recommendations, limitations, and reproducible `tp` commands.
63
+
64
+ For every major finding include the period, cost or token share, evidence source, confidence level, and a plausible alternative explanation.
65
+
66
+ ## Related Skills
67
+
68
+ - Use `thinkplatform-agent-ops` when the user asks to change Agent prompts, models, tools, skills, memories, or team design.
69
+ - Use `thinkplatform-automation-ops` when the user asks to change schedules, retries, Hooks, Webhooks, or follow-ups.
70
+ - Use `thinkplatform-data-engineering` when repeated Data Lake reads or data preparation should be redesigned.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "ThinkPlatform Agent Cost Analysis"
3
+ short_description: "Diagnose Agent and LLM cost drivers"
4
+ default_prompt: "Use $thinkplatform-agent-cost-analysis to audit this ThinkPlatform project Agent and LLM costs."
@@ -0,0 +1,105 @@
1
+ # ThinkPlatform Agent / LLM Cost Analysis
2
+
3
+ ## Scope
4
+
5
+ - Profile:
6
+ - Organization / project:
7
+ - Analysis period:
8
+ - Comparison period:
9
+ - Providers / currency:
10
+ - Snapshot:
11
+ - Report generated:
12
+
13
+ ## Executive summary
14
+
15
+ | Rank | Critical factor | Estimated affected share | Confidence | Why it matters |
16
+ |---:|---|---:|---|---|
17
+ | 1 | | | | |
18
+
19
+ ## Cost reconciliation
20
+
21
+ | Measure | Amount | Share | Notes |
22
+ |---|---:|---:|---|
23
+ | Provider actual | | 100% | |
24
+ | Allocated to target project | | | |
25
+ | Runtime measured | | | |
26
+ | Unallocated | | | |
27
+
28
+ Provider status, timestamps, currency, and coverage limitations:
29
+
30
+ ### Data quality
31
+
32
+ | Check | Result | Analytical impact |
33
+ |---|---|---|
34
+ | Model cost/request coverage | | |
35
+ | Agent/task coverage | | |
36
+ | Provider freshness | | |
37
+ | Inventory/log truncation | | |
38
+ | Raw API fallback | | |
39
+
40
+ ## Trend and change points
41
+
42
+ | Date/window | Cost | Requests/tasks | Tokens | Relevant configuration/event |
43
+ |---|---:|---:|---:|---|
44
+ | | | | | |
45
+
46
+ ## Ranked drivers
47
+
48
+ ### Models
49
+
50
+ | Model | Cost/share | Requests/share | Input/cached/output/reasoning | Interpretation |
51
+ |---|---:|---:|---|---|
52
+ | | | | | |
53
+
54
+ ### Agents and tasks
55
+
56
+ | Agent/task | Cost/share | Runs/requests | Evidence | Interpretation |
57
+ |---|---:|---:|---|---|
58
+ | | | | | |
59
+
60
+ ### Schedules and triggers
61
+
62
+ | Schedule/trigger | Intended volume | Observed volume | Retry/duplicate overhead | Cost implication |
63
+ |---|---:|---:|---:|---|
64
+ | | | | | |
65
+
66
+ ### Prompt, context, skills, and data tools
67
+
68
+ | Evidence | Observed behavior | Cost mechanism | Confidence |
69
+ |---|---|---|---|
70
+ | | | | |
71
+
72
+ ## Hypothesis assessment
73
+
74
+ | Hypothesis | Result | Quantified evidence | Alternative explanation |
75
+ |---|---|---|---|
76
+ | Expensive model mix | | | |
77
+ | Required schedule volume | | | |
78
+ | Prompt or skill bloat | | | |
79
+ | Repeated context/file conversion | | | |
80
+ | Retry, fan-out, or Agent loop | | | |
81
+ | Attribution/measurement issue | | | |
82
+
83
+ ## Recommendations
84
+
85
+ No configuration was changed during this analysis.
86
+
87
+ | Priority | Recommendation | Mechanism | Expected impact | Quality guardrail / validation |
88
+ |---:|---|---|---|---|
89
+ | 1 | | | | |
90
+
91
+ ## Limitations
92
+
93
+ -
94
+
95
+ ## Reproduction
96
+
97
+ ```bash
98
+ # Exact read-only tp commands used
99
+ ```
100
+
101
+ ## Pricing sources
102
+
103
+ - Provider/model/tier:
104
+ - Official URL:
105
+ - Accessed:
@@ -0,0 +1,130 @@
1
+ # ThinkPlatform cost-analysis commands
2
+
3
+ Use root options before the command:
4
+
5
+ ```bash
6
+ tp --profile PROFILE --json COMMAND
7
+ ```
8
+
9
+ When `tp` is not on `PATH`, run from `thinkplatform-lib` with `.venv/bin/tp` or pass `--tp-bin /absolute/path/to/.venv/bin/tp` to the collector. The collector auto-detects the repository `.venv/bin/tp`.
10
+
11
+ All commands in this reference are read-only.
12
+
13
+ ## Context and profile
14
+
15
+ ```bash
16
+ tp --json profile list
17
+ tp --profile PROFILE --json profile show PROFILE
18
+ tp --profile PROFILE --json context show
19
+ ```
20
+
21
+ Confirm that `org_id` and `project_id` match the requested scope. Do not silently switch the active profile.
22
+
23
+ ## Cost and attribution
24
+
25
+ Use explicit dates:
26
+
27
+ ```bash
28
+ tp --profile PROFILE --json costs overview \
29
+ --from YYYY-MM-DD --to YYYY-MM-DD
30
+
31
+ tp --profile PROFILE --json costs allocation \
32
+ --from YYYY-MM-DD --to YYYY-MM-DD --group-by project
33
+
34
+ tp --profile PROFILE --json costs allocation \
35
+ --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_model
36
+
37
+ tp --profile PROFILE --json costs allocation \
38
+ --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_agent
39
+
40
+ tp --profile PROFILE --json costs allocation \
41
+ --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_task
42
+
43
+ tp --profile PROFILE --json costs allocation \
44
+ --from YYYY-MM-DD --to YYYY-MM-DD --group-by project_user
45
+
46
+ tp --profile PROFILE --json costs budgets
47
+ ```
48
+
49
+ Useful options:
50
+
51
+ - `--provider openai|azure_openai|azure|all`
52
+ - `--metric ActualCost|AmortizedCost`
53
+ - `--force-refresh` when stale cached provider data would materially affect the result
54
+ - `--exclude-unallocated` only for a focused view; retain unallocated cost in the reconciliation
55
+
56
+ ### Fallback for older CLI installations
57
+
58
+ ```bash
59
+ tp --profile PROFILE --json raw get \
60
+ /api/organizations/ORG_ID/costs/allocation \
61
+ --query from=YYYY-MM-DD \
62
+ --query to=YYYY-MM-DD \
63
+ --query groupBy=project_model
64
+ ```
65
+
66
+ The server must also support the requested grouping. If it does not, record the missing dimension as a limitation and use tasks, Agents, and provider breakdowns as secondary evidence.
67
+
68
+ ## Agent and task configuration
69
+
70
+ ```bash
71
+ tp --profile PROFILE --json agents list --limit 200 --include-tools
72
+ tp --profile PROFILE --json agents teams list
73
+ tp --profile PROFILE --json agents models
74
+ tp --profile PROFILE --json skills list --limit 200
75
+ tp --profile PROFILE --json skills get SKILL_ID
76
+ tp --profile PROFILE --json tasks list \
77
+ --activity-from FROM_ISO --activity-to TO_ISO --limit 200 --offset 0
78
+ tp --profile PROFILE --json tasks list \
79
+ --thread-id THREAD_ID --activity-from FROM_ISO --activity-to TO_ISO
80
+ tp --profile PROFILE --json tasks get TASK_ID
81
+ tp --profile PROFILE --json tasks messages TASK_ID --summary
82
+ ```
83
+
84
+ Only retrieve raw task messages after selecting an anomalous task:
85
+
86
+ ```bash
87
+ tp --profile PROFILE --json tasks messages TASK_ID
88
+ ```
89
+
90
+ Do not paste raw message content into the report. Report sizes, repetition, tool names, and short paraphrases.
91
+
92
+ ## Schedules and triggers
93
+
94
+ ```bash
95
+ tp --profile PROFILE --json automation schedules list
96
+ tp --profile PROFILE --json automation schedules agent-log APP_ID \
97
+ --from FROM_ISO --to TO_ISO --limit 500 --summary
98
+ tp --profile PROFILE --json hooks list
99
+ tp --profile PROFILE --json webhooks list
100
+ tp --profile PROFILE --json tasks followups TASK_ID --include-inactive
101
+ ```
102
+
103
+ Inspect:
104
+
105
+ - interval/trigger and enabled status;
106
+ - target Agent and schedule prompt;
107
+ - run count, status mix, attempts, repeated task IDs, and errors;
108
+ - overlapping schedules, Hooks, Webhooks, and task follow-ups that can trigger the same work.
109
+
110
+ ## Data-context investigation
111
+
112
+ After message summaries indicate file-heavy tool use, inspect only the implicated paths:
113
+
114
+ ```bash
115
+ tp --profile PROFILE --json datalake tree --path REMOTE_PATH
116
+ tp --profile PROFILE --json datalake list --path REMOTE_PATH
117
+ tp --profile PROFILE --json datalake preview --path REMOTE_FILE
118
+ ```
119
+
120
+ Look for repeated reads of large or numerous files, raw PDFs/images requiring conversion, and missing curated indexes or summaries. Do not enumerate the entire Data Lake without evidence that it is required.
121
+
122
+ ## Snapshot collector
123
+
124
+ ```bash
125
+ tp-agent-cost-snapshot --help
126
+ ```
127
+
128
+ The default top-task and schedule summaries are bounded. Increase limits deliberately when the initial ranking shows a long tail that matters.
129
+
130
+ Read `collection_warnings`, `derived.dimension_coverage`, and `derived.collection_coverage` before conclusions. Scheduler `status_counts` describe enqueue records, not downstream task outcomes; correlate them with task status.
@@ -0,0 +1,87 @@
1
+ # Provider-aware Agent cost model
2
+
3
+ ## Source-of-truth order
4
+
5
+ Use evidence in this order:
6
+
7
+ 1. Provider billed/actual cost for financial totals.
8
+ 2. ThinkPlatform allocated provider actuals for project, user, Agent, task, and model attribution.
9
+ 3. Runtime measured `estimatedCost` for diagnostic detail.
10
+ 4. Token/request/duration proxies when direct cost is unavailable.
11
+
12
+ Provider actuals and runtime estimates can differ because of reporting delay, currency conversion, discounts, tiers, rounding, cached-token treatment, tool charges, credits, and incomplete attribution. Reconcile the differences instead of blending them.
13
+
14
+ ## General formula
15
+
16
+ For each provider, model, service tier, and context tier:
17
+
18
+ ```text
19
+ request cost
20
+ = uncached input tokens × uncached input rate
21
+ + cached input tokens × cached input rate
22
+ + cache-write tokens × cache-write rate
23
+ + output tokens × output rate
24
+ + audio/image tokens × modality rates
25
+ + built-in tool, storage, retrieval, container, or other service charges
26
+ ```
27
+
28
+ Then:
29
+
30
+ ```text
31
+ period cost = sum(request cost) + fixed/provisioned capacity charges
32
+ ```
33
+
34
+ Do not assume all providers expose every component or that cached tokens are separate from total input tokens. Confirm field semantics before subtracting or adding token categories.
35
+
36
+ ## Metrics to calculate
37
+
38
+ - Cost share: `slice actual cost / project actual cost`.
39
+ - Activity share: `slice requests / project requests`.
40
+ - Effective cost per request: `slice actual cost / slice requests`.
41
+ - Effective cost per million input/output tokens: use only when token coverage is adequate and label it as blended.
42
+ - Cache ratio: `cached input tokens / input tokens` only when input tokens include cached tokens.
43
+ - Output amplification: `output tokens / input tokens`.
44
+ - Reasoning share: `reasoning tokens / output tokens` only when the provider documents reasoning as part of output.
45
+ - Daily execution rate: `requests or tasks / active days`.
46
+ - Schedule overhead: failed, retried, duplicated, or overlapping executions × representative task cost.
47
+ - Concentration: cost share of top model, Agent, task, user, and day.
48
+
49
+ Always handle zero denominators and disclose low token coverage.
50
+
51
+ ## Current pricing verification
52
+
53
+ Pricing is time-sensitive. At analysis time, verify the specific provider, model snapshot, region, service tier, and context length using official sources:
54
+
55
+ - OpenAI API pricing: <https://developers.openai.com/api/docs/pricing>
56
+ - OpenAI prompt caching: <https://developers.openai.com/api/docs/guides/prompt-caching>
57
+ - OpenAI Batch API: <https://developers.openai.com/api/docs/guides/batch>
58
+ - OpenAI Usage API: <https://platform.openai.com/docs/api-reference/usage>
59
+ - Azure OpenAI pricing: <https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/>
60
+ - Azure OpenAI prompt caching: <https://learn.microsoft.com/azure/ai-services/openai/how-to/prompt-caching>
61
+ - Azure provisioned throughput billing: <https://learn.microsoft.com/azure/foundry/openai/concepts/provisioned-throughput-billing>
62
+
63
+ Record the URL and access date in the report. Do not copy a price from this skill.
64
+
65
+ ## Pricing distinctions that change conclusions
66
+
67
+ - Input, cached input, cache writes, and output can have different rates.
68
+ - Long-context tiers can change rates above provider-specific thresholds.
69
+ - Standard, Batch, Flex, priority/fast, and provisioned capacity have different economics.
70
+ - Some built-in tools and storage are billed separately from model tokens.
71
+ - Azure Standard token billing and provisioned throughput unit/hour billing require different utilization analyses.
72
+ - A cheaper model that increases retries, output, or tool loops can cost more per successful outcome.
73
+
74
+ ## Prompt caching interpretation
75
+
76
+ Caching helps only when requests are eligible and share an exact stable prefix under the provider's rules. Place stable instructions and common context before variable user/task content when platform behavior permits.
77
+
78
+ Do not call low cache usage waste when:
79
+
80
+ - requests are below the provider's cache eligibility threshold;
81
+ - prompts legitimately differ at the beginning;
82
+ - traffic is too sparse or separated beyond cache lifetime;
83
+ - the provider/model/tier does not support the expected cache behavior.
84
+
85
+ ## Currency and billing period
86
+
87
+ Keep provider currencies separate unless ThinkPlatform supplies a documented conversion. State the exchange-rate source and date when converting. Align analysis dates with provider reporting timezone and note that very recent days may be incomplete.