@netoalmanca/advpl-sensei 1.1.0
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/agents/changelog-generator.md +63 -0
- package/agents/code-generator.md +215 -0
- package/agents/code-reviewer.md +145 -0
- package/agents/debugger.md +83 -0
- package/agents/doc-generator.md +67 -0
- package/agents/docs-reference.md +86 -0
- package/agents/migrator.md +84 -0
- package/agents/process-consultant.md +97 -0
- package/agents/refactorer.md +75 -0
- package/agents/sx-configurator.md +67 -0
- package/commands/changelog.md +66 -0
- package/commands/diagnose.md +67 -0
- package/commands/docs.md +81 -0
- package/commands/document.md +67 -0
- package/commands/explain.md +60 -0
- package/commands/generate.md +111 -0
- package/commands/migrate.md +81 -0
- package/commands/process.md +111 -0
- package/commands/refactor.md +65 -0
- package/commands/review.md +60 -0
- package/commands/sxgen.md +98 -0
- package/commands/test.md +103 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +143 -0
- package/dist/index.js.map +1 -0
- package/package.json +30 -0
- package/skills/advpl-code-generation/SKILL.md +163 -0
- package/skills/advpl-code-generation/patterns-fwformbrowse.md +485 -0
- package/skills/advpl-code-generation/patterns-jobs.md +519 -0
- package/skills/advpl-code-generation/patterns-mvc.md +765 -0
- package/skills/advpl-code-generation/patterns-pontos-entrada.md +708 -0
- package/skills/advpl-code-generation/patterns-rest.md +974 -0
- package/skills/advpl-code-generation/patterns-soap.md +639 -0
- package/skills/advpl-code-generation/patterns-treport.md +481 -0
- package/skills/advpl-code-generation/patterns-workflow.md +779 -0
- package/skills/advpl-code-generation/templates-classes.md +1096 -0
- package/skills/advpl-code-review/SKILL.md +72 -0
- package/skills/advpl-code-review/rules-best-practices.md +444 -0
- package/skills/advpl-code-review/rules-modernization.md +290 -0
- package/skills/advpl-code-review/rules-performance.md +333 -0
- package/skills/advpl-code-review/rules-security.md +302 -0
- package/skills/advpl-debugging/SKILL.md +265 -0
- package/skills/advpl-debugging/common-errors.md +1124 -0
- package/skills/advpl-debugging/performance-tips.md +768 -0
- package/skills/advpl-refactoring/SKILL.md +139 -0
- package/skills/advpl-to-tlpp-migration/SKILL.md +293 -0
- package/skills/advpl-to-tlpp-migration/migration-checklist.md +122 -0
- package/skills/advpl-to-tlpp-migration/migration-rules.md +265 -0
- package/skills/changelog-patterns/SKILL.md +99 -0
- package/skills/code-explanation/SKILL.md +66 -0
- package/skills/documentation-patterns/SKILL.md +172 -0
- package/skills/embedded-sql/SKILL.md +379 -0
- package/skills/probat-testing/SKILL.md +226 -0
- package/skills/probat-testing/patterns-unit-tests.md +614 -0
- package/skills/protheus-business/SKILL.md +92 -0
- package/skills/protheus-business/modulo-compras.md +780 -0
- package/skills/protheus-business/modulo-contabilidade.md +874 -0
- package/skills/protheus-business/modulo-estoque.md +876 -0
- package/skills/protheus-business/modulo-faturamento.md +800 -0
- package/skills/protheus-business/modulo-financeiro.md +1015 -0
- package/skills/protheus-business/modulo-fiscal.md +749 -0
- package/skills/protheus-business/modulo-manutencao.md +848 -0
- package/skills/protheus-business/modulo-pcp.md +743 -0
- package/skills/protheus-reference/SKILL.md +119 -0
- package/skills/protheus-reference/native-functions.md +7029 -0
- package/skills/protheus-reference/rest-api-reference.md +1758 -0
- package/skills/protheus-reference/restricted-functions.md +265 -0
- package/skills/protheus-reference/sx-dictionary.md +854 -0
- package/skills/sx-configuration/SKILL.md +184 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: protheus-reference
|
|
3
|
+
description: Use when looking up Protheus native functions, SX data dictionary tables, REST API endpoints, MV parameters, or TOTVS framework documentation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Protheus Reference
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Reference guide for the TOTVS Protheus ecosystem. Provides quick access to native functions, data dictionary (SX tables), REST API endpoints, and system parameters (MV_*).
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Looking up native function syntax, parameters, or return values
|
|
15
|
+
- Understanding SX data dictionary structure (SX1 through SX9, SIX)
|
|
16
|
+
- Finding REST API endpoints for Protheus integration
|
|
17
|
+
- Checking MV_* parameter purpose and default values
|
|
18
|
+
- Understanding .ini configuration files (appserver.ini, smartclient.ini)
|
|
19
|
+
|
|
20
|
+
## Lookup Strategy
|
|
21
|
+
|
|
22
|
+
```dot
|
|
23
|
+
digraph lookup {
|
|
24
|
+
"Need function/API info?" [shape=diamond];
|
|
25
|
+
"Check native-functions.md" [shape=box];
|
|
26
|
+
"Found?" [shape=diamond];
|
|
27
|
+
"Return result" [shape=box];
|
|
28
|
+
"Search TDN online" [shape=box];
|
|
29
|
+
"WebSearch: site:tdn.totvs.com <term>" [shape=box];
|
|
30
|
+
"Fetch failed?" [shape=diamond];
|
|
31
|
+
"Playwright fallback" [shape=box];
|
|
32
|
+
|
|
33
|
+
"Need function/API info?" -> "Check native-functions.md";
|
|
34
|
+
"Check native-functions.md" -> "Found?";
|
|
35
|
+
"Found?" -> "Return result" [label="yes"];
|
|
36
|
+
"Found?" -> "Search TDN online" [label="no"];
|
|
37
|
+
"Search TDN online" -> "WebSearch: site:tdn.totvs.com <term>";
|
|
38
|
+
"WebSearch: site:tdn.totvs.com <term>" -> "Fetch failed?";
|
|
39
|
+
"Fetch failed?" -> "Return result" [label="no"];
|
|
40
|
+
"Fetch failed?" -> "Playwright fallback" [label="yes"];
|
|
41
|
+
"Playwright fallback" -> "Return result";
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
1. **Local first:** Check supporting files (native-functions.md, sx-dictionary.md, rest-api-reference.md)
|
|
46
|
+
2. **Online fallback:** Search TDN with `WebSearch` using query: `site:tdn.totvs.com <function_name>`
|
|
47
|
+
3. **WebFetch TDN page:** If URL found, use `WebFetch` to extract details
|
|
48
|
+
4. **Playwright fallback:** Se `WebSearch` ou `WebFetch` falhar, use Playwright MCP:
|
|
49
|
+
- `browser_navigate` para a URL do TDN (se disponível) ou buscar em `https://tdn.totvs.com`
|
|
50
|
+
- `browser_snapshot` para extrair texto; se insuficiente, `browser_take_screenshot` para captura visual
|
|
51
|
+
- `browser_close` ao finalizar para liberar recursos
|
|
52
|
+
|
|
53
|
+
## CRITICAL: Restricted Functions Check
|
|
54
|
+
|
|
55
|
+
**Before recommending any function, ALWAYS check if it appears in `restricted-functions.md`.** TOTVS maintains a list of 195+ functions/classes that are internal property and MUST NOT be used in custom code. Some have their compilation blocked since release 12.1.33.
|
|
56
|
+
|
|
57
|
+
See `restricted-functions.md` for the complete list and supported alternatives.
|
|
58
|
+
|
|
59
|
+
## Function Categories
|
|
60
|
+
|
|
61
|
+
| Category | Common Functions | File Reference |
|
|
62
|
+
|----------|-----------------|----------------|
|
|
63
|
+
| String | Alltrim, SubStr, StrTran, Pad*, Upper, Lower | native-functions.md |
|
|
64
|
+
| Date/Time | dDataBase, DtoS, StoD, Day, Month, Year | native-functions.md |
|
|
65
|
+
| Array | aAdd, aDel, aSize, aScan, aSort, aClone | native-functions.md |
|
|
66
|
+
| Database | DbSelectArea, DbSetOrder, DbSeek, RecLock, MsUnlock | native-functions.md |
|
|
67
|
+
| Interface | MsgInfo, MsgYesNo, MsgAlert, FWExecView, Enchoice | native-functions.md |
|
|
68
|
+
| File I/O | FOpen, FRead, FWrite, FClose, FErase, Directory | native-functions.md |
|
|
69
|
+
| Network | HttpGet, HttpPost, FWRest, WsRestFul | native-functions.md |
|
|
70
|
+
| System | GetMV, PutMV, SuperGetMV, Conout, FWLogMsg | native-functions.md |
|
|
71
|
+
| Company/Branch | FWCodFil, FWCodEmp, FWFilial, FWCompany, xFilial | native-functions.md |
|
|
72
|
+
| JsonObject | New, FromJSON, toJSON, GetNames, HasProperty, GetJsonObject, GetJsonText, GetJsonValue, DelName, Set | native-functions.md |
|
|
73
|
+
| TWsdlManager | New, ParseURL, ParseFile, SetOperation, SendSoapMsg, GetParsedResponse, GetSoapResponse, GetSoapMsg, ListOperations, SetPort, SetValue | native-functions.md |
|
|
74
|
+
| Browse/UI | FwBrowse, FWMarkBrowse, FWBrwColumn, FWBrwRelation, FWLegend, FWCalendar, FWSimpEdit | native-functions.md |
|
|
75
|
+
| Process | FWGridProcess, tNewProcess | native-functions.md |
|
|
76
|
+
| WorkArea | FwGetArea, FwRestArea | native-functions.md |
|
|
77
|
+
| User | FwGetUserName, UsrRetName | native-functions.md |
|
|
78
|
+
| Dialog | FWMsgRun, FWInputBox | native-functions.md |
|
|
79
|
+
| Memory | FWFreeObj, FWFreeVar | native-functions.md |
|
|
80
|
+
| Date ISO | Fw8601ToDate, FWDateTo8601 | native-functions.md |
|
|
81
|
+
| URL Encode | FWHttpEncode, FWURIDecode | native-functions.md |
|
|
82
|
+
| Semaphore | MayIUseCode, MPCriaNumS | native-functions.md |
|
|
83
|
+
| Dictionary | FWX3Titulo, FWX2CHAVE, FWX2Unico | native-functions.md |
|
|
84
|
+
| Interface | SaveInter, RestInter | native-functions.md |
|
|
85
|
+
| ExecAuto | MsGetDAuto, MsExecAuto, FWMVCRotAuto | native-functions.md |
|
|
86
|
+
| Restricted | StaticCall, PTInternal, PARAMBOX, etc. | restricted-functions.md |
|
|
87
|
+
|
|
88
|
+
## Data Dictionary Quick Reference
|
|
89
|
+
|
|
90
|
+
| Table | Purpose |
|
|
91
|
+
|-------|---------|
|
|
92
|
+
| SX1 | Perguntas (parameters for reports/routines) |
|
|
93
|
+
| SX2 | Tabelas (table definitions) |
|
|
94
|
+
| SX3 | Campos (field definitions) |
|
|
95
|
+
| SX5 | Tabelas genericas (generic lookup tables) |
|
|
96
|
+
| SX6 | Parametros (MV_* system parameters) |
|
|
97
|
+
| SX7 | Gatilhos (field triggers) |
|
|
98
|
+
| SX9 | Relacionamentos (table relationships) |
|
|
99
|
+
| SXB | Consultas padrao (standard queries) |
|
|
100
|
+
| SIX | Indices (index definitions) |
|
|
101
|
+
|
|
102
|
+
See `sx-dictionary.md` for complete structure with field descriptions.
|
|
103
|
+
|
|
104
|
+
## REST API Patterns
|
|
105
|
+
|
|
106
|
+
Protheus REST APIs follow two main patterns:
|
|
107
|
+
|
|
108
|
+
1. **FWRest Framework** (newer): Annotation-based with `@Get`, `@Post`, `@Put`, `@Delete`
|
|
109
|
+
2. **WsRestFul** (legacy): Class-based with `wsmethod`
|
|
110
|
+
|
|
111
|
+
See `rest-api-reference.md` for endpoint patterns and authentication.
|
|
112
|
+
|
|
113
|
+
## Online Search Tips
|
|
114
|
+
|
|
115
|
+
When searching TDN (TOTVS Developer Network):
|
|
116
|
+
- Use `WebSearch` with query: `site:tdn.totvs.com <function_name> advpl`
|
|
117
|
+
- For API docs: `site:tdn.totvs.com rest api <endpoint_name>`
|
|
118
|
+
- For release notes: `site:tdn.totvs.com <feature> release notes`
|
|
119
|
+
- TDN base URL: `https://tdn.totvs.com`
|